﻿/*! For license information please see comments.js.LICENSE.txt */
(()=>{var __webpack_modules__={6610:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{default:()=>r})},5991:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,{default:()=>o})},96156:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{default:()=>r})},90484:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{default:()=>r})},68518:(e,t,n)=>{"use strict";function r(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}n.d(t,{isBrowserBundle:()=>r})},82991:(e,t,n)=>{"use strict";n.d(t,{getGlobalObject:()=>i});var r=n(61422),o={};function i(){return(0,r.isNodeEnv)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:o}},61422:(e,t,n)=>{"use strict";n.d(t,{isNodeEnv:()=>o});var r=n(68518);function o(){return!(0,r.isBrowserBundle)()&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}e=n.hmd(e)},30360:(e,t,n)=>{"use strict";n.d(t,{getFunctionName:()=>o});n(50832);var r="<anonymous>";function o(e){try{return e&&"function"==typeof e&&e.name||r}catch(e){return r}}},50832:(e,t,n)=>{"use strict";n.d(t,{__assign:()=>r,__values:()=>o});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}},64380:(e,t,n)=>{"use strict";n.d(t,{HangupType:()=>F});n(45580);var r,o,i=n(6257),a=n.n(i),s=n(24736),c=n.n(s),l=n(38797),u=n(36090),d=n(35557),_=Object.defineProperty,p=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,m=Math.pow,g=(e,t,n)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{s(n.next(e))}catch(e){o(e)}},a=e=>{try{s(n.throw(e))}catch(e){o(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())})),y=class{constructor(){this._handlers={},this._listeners=[]}_triggerEvent(e,...t){if(this._handlers.hasOwnProperty(e))for(let n of this._handlers[e])n.apply(this,t)}addEventListener(e,t){if("function"!=typeof t)throw new Error("Listener should be a function");return this._handlers.hasOwnProperty(e)||(this._handlers[e]=[]),this._handlers[e].push(t),{dispose:this.removeEventListener.bind(this,e,t)}}removeEventListener(e,t){if(!this._handlers.hasOwnProperty(e))return;t||delete this._handlers[e];let n=this._handlers[e].indexOf(t);n>=0&&this._handlers[e].splice(n,1)}subscribe(e,t,n){let r=e.addEventListener(t,n);this._listeners.push(r)}unsubscribe(){this._listeners.forEach((e=>{e.dispose()}))}},E=class extends y{get ready(){return!0}setParticipantIdRegistry(e){}requestRealloc(){}setEndpoint(e){}setConversationId(e){}readyToSend(){}cleanup(){}requestTestMode(e){}getNextCommandSequenceNumber(){return 0}},w=((r=w||{}).INCOMING="INCOMING",r.OUTGOING="OUTGOING",r.JOINING="JOINING",r),b=w,C=(e=>(e.USER="USER",e.GROUP="GROUP",e.CHAT="CHAT",e))(C||{}),S=C,T=((o=T||{}).ATTENDEE="ATTENDEE",o.HAND_UP="HAND_UP",o),D=T,P=(e=>(e.ADD_PARTICIPANT="ADD_PARTICIPANT",e.RECORD="RECORD",e))(P||{}),A=P,k=(e=>(e.REQUIRE_AUTH_TO_JOIN="REQUIRE_AUTH_TO_JOIN",e.AUDIENCE_MODE="AUDIENCE_MODE",e.WAITING_HALL="WAITING_HALL",e))(k||{}),I=k;var O,x,R,M,L,N=((O=N||{}).CAMERA_PERMISSION="camera",O.MIC_PERMISSION="mic",O.CAMERA_ACCESS="cameralock",O.MIC_ACCESS="miclock",O.MIC_NOT_FOUND="nomic",O.SCREEN_PERMISSION="screenpermission",O.SCREEN_ACCESS="screenlock",O.CONNECTION="connection",O.NETWORK="network",O.UNKNOWN="unknown",O.UNSUPPORTED="unsupported",O.SIGNALING_FAILED="signalingfailed",O.API="api",O.AUTH="auth",O),B=N,U=((x=U||{}).CANCELED="CANCELED",x.REJECTED="REJECTED",x.REMOVED="REMOVED",x.HUNGUP="HUNGUP",x.MISSED="MISSED",x.BUSY="BUSY",x.FAILED="FAILED",x.NETWORK_ERROR="NETWORK_ERROR",x.KILLED="KILLED",x.BANNED="BANNED",x.CALLER_IS_BLOCKED="CALLER_IS_BLOCKED",x.NOT_FRIENDS="NOT_FRIENDS",x.CALLEE_IS_OFFLINE="CALLEE_IS_OFFLINE",x.UNKNOWN_ERROR="UNKNOWN_ERROR",x.UNSUPPORTED="UNSUPPORTED",x.OLD_VERSION="OLD_VERSION",x.SERVICE_DISABLED="SERVICE_DISABLED",x.EXTERNAL_API_ERROR="EXTERNAL_API_ERROR",x.SOCKET_CLOSED="SOCKET_CLOSED",x.ENDED="ENDED",x),F=U,W=(e=>(e.AUDIO="AUDIO",e.VIDEO="VIDEO",e.SCREEN_SHARING="SCREEN_SHARING",e))(W||{}),j=W,V=(e=>(e.UNMUTE="UNMUTE",e.MUTE="MUTE",e.MUTE_PERMANENT="MUTE_PERMANENT",e))(V||{}),H=V,K=((R=K||{}).CALLED="CALLED",R.ACCEPTED="ACCEPTED",R.REJECTED="REJECTED",R.HUNGUP="HUNGUP",R),G=K,z=(e=>(e.START="start",e.ACCEPT="accept",e.JOIN="join",e.RETRY="retry",e))(z||{}),q=z,$=(e=>(e.NOTIFICATION="NOTIFICATION",e.FAILED="FAILED",e.RECONNECT="RECONNECT",e))($||{}),Y=$,Q=((M=Q||{}).TRANSMITTED_DATA="transmitted-data",M.ACCEPTED_CALL="accepted-call",M.HUNGUP="hungup",M.PARTICIPANT_ADDED="participant-added",M.PARTICIPANT_JOINED="participant-joined",M.CLOSED_CONVERSATION="closed-conversation",M.MEDIA_SETTINGS_CHANGED="media-settings-changed",M.PARTICIPANT_STATE_CHANGED="participant-state-changed",M.RATE_CALL_DATA="rate-call-data",M.FEATURE_SET_CHANGED="feature-set-changed",M.TOPOLOGY_CHANGED="topology-changed",M.PRODUCER_UPDATED="producer-updated",M.CONSUMER_ANSWERED="consumer-answered",M.MULTIPARTY_CHAT_CREATED="multiparty-chat-created",M.FORCE_MEDIA_SETTINGS_CHANGE="force-media-settings-change",M.SETTINGS_UPDATE="settings-update",M.VIDEO_QUALITY_UPDATE="video-quality-update",M.REGISTERED_PEER="registered-peer",M.SWITCH_MICRO="switch-micro",M.RECORD_STARTED="record-started",M.RECORD_STOPPED="record-stopped",M.REALLOC_CON="realloc-con",M.AUDIO_ACTIVITY="audio-activity",M.SPEAKER_CHANGED="speaker-changed",M.STALLED_ACTIVITY="stalled-activity",M.CHAT_MESSAGE="chat-message",M.CUSTOM_DATA="custom-data",M.ROLES_CHANGED="roles-changed",M.MUTE_PARTICIPANT="mute-participant",M.PIN_PARTICIPANT="pin-participant",M.OPTIONS_CHANGED="options-changed",M.NETWORK_STATUS="network-status",M.PARTICIPANT_SOURCES_UPDATE="participant-sources-update",M.PROMOTE_PARTICIPANT="promote-participant",M.CHAT_ROOM_UPDATED="chat-room-updated",M.PROMOTION_APPROVED="promotion-approved",M.JOIN_LINK_CHANGED="join-link-changed",M),X=Q,J=((L=J||{}).ERROR="callError",L.DEVICES="callDevices",L.CALL_SPEC_ERROR="callSpecError",L.ICE_CONNECTION_STATE="callIceConnectionState",L.ICE_CONNECTION_TYPE="callIceConnectionType",L.ICE_RESTART="callIceRestart",L.PUSH="callPush",L.OUTGOING_CALL="callStart",L.OUTGOING_MULTIPARTY_CALL="callStartMultiparty",L.JOIN_CONVERSATION="callJoinConversation",L.ACCEPTED_OUTGOING="callAcceptedOutgoing",L.ACCEPT_INCOMING="callAcceptIncoming",L.DECLINE_INCOMING="callDeclineIncoming",L.ACCEPT_CONCURRENT="callAcceptConcurrent",L.HANGUP="callHangup",L.MEDIA_STATUS="callMediaStatus",L.DEVICE_CHANGED="callDeviceChanged",L.SOCKET_ACTION="callSocketAction",L.ADD_PARTICIPANT="callAddParticipant",L.REMOVE_PARTICIPANT="callRemoveParticipant",L.POOR_CONNECTION="callPoorConnection",L.TOPOLOGY_CHANGE_REQUESTED="callTopologyChangeRequested",L.RELAY_POLICY="callForceRelay",L.PAT_ALLOCATED="patAllocate",L.PAT_DEALLOCATED="patDeallocate",L.PAT_ERROR="patError",L.PAT_WAITING_TIME_ERROR="patWaitingTimeError",L.PAT_OUTDATED_RESPONSE="patOutdatedResponse",L),Z=J,ee=(e=>(e.AUDIO_MIX="audio-mix",e.PARTICIPANT_AGNOSTIC_TRACK_PREFIX="pat",e))(ee||{}),te=ee,ne=(e=>(e.NO_AVAILABLE_TRACKS="no-available-tracks",e.UNKNOWN_ERROR="unknown-error",e))(ne||{}),re=ne;var oe=(e=>(e.CREATOR="CREATOR",e.ADMIN="ADMIN",e))(oe||{}),ie=oe;function ae(e,t){if(e.length!==t.length)return!1;for(let n of e)if(!t.includes(n))return!1;return!0}var se=(e=>(e.USER="USER",e.GROUP="GROUP",e))(se||{}),ce=se,le=2097152,ue=102400,de="_okcls_logs_session_";function _e(){return`${de}${Date.now()}`}function pe(e){return new Blob([e]).size}function he(e){try{window.localStorage.removeItem(e)}catch(e){console.error("Failed to remove log from storage",e)}}function fe(){let e=Ee.toString();if(!ye.available||!e)return;let t=pe(e);ye.cleanup(t);try{window.localStorage.setItem(we,e)}catch(e){return console.warn("Failed to write log to storage",e),ye.storageSize=ye.size+t,ye.cleanup(ue+t),ye.available>=ue+t?void fe():t>ue?(Ee.bisect(),void fe()):void(ye.storageSize=0)}t>524288&&(ye.add(we,t),we=_e(),Ee.clear(),ye.cleanup(ue))}function me(){!ye.available||!Ee.length||fe()}function ge(e=!1){let t=[];try{let e=window.localStorage;for(let n of ye.items){let r=e.getItem(n.key);t.push(r)}let n=Ee.toString();n&&t.push(n)}catch(e){console.error("Storage is blocked",e)}let n=`[${t.join(",")}]`;if(e)return n;let r=`logs_${Date.now()}.json`;return function(e,t){let n=document.createElement("a"),r=new Blob([e],{type:"text/json"});n.href=URL.createObjectURL(r),n.download=t,n.click()}(n,r),r}function ve(){ye||(ye=new class{constructor(){this._items=[],this._itemsSize=0,this._storageSize=le;try{let e=window.localStorage;for(let t of Object.keys(e)){if(0!==t.indexOf(de))continue;let n=e.getItem(t);if(!n){he(t);continue}let r=pe(n);this.add(t,r)}}catch(e){console.error("Storage is blocked",e),this._storageSize=0}this._items.sort(((e,t)=>e.date-t.date)),this.cleanup(ue)}get size(){return this._itemsSize}get length(){return this._items.length}get available(){return Math.max(this._storageSize-this._itemsSize,0)}get items(){return this._items}set storageSize(e){this._storageSize=e}add(e,t){let n=parseInt(e.replace(de,""),10);this._itemsSize+=t,this._items.push({key:e,size:t,date:n})}deleteOldestItem(){let e=this._items.shift();e&&(he(e.key),this._itemsSize-=e.size)}cleanup(e){for(;this.length&&(this.size>le||this.length>4||this.size+e>this.available);)this.deleteOldestItem()}},Ee=new class{constructor(){this._items=[]}get length(){return this._items.length}push(e){this._items.push(e)}shift(){return this._items.shift()||null}bisect(){let e=this.length>1?Math.floor(this.length/2):1;this._items=this._items.slice(e)}clear(){this._items=[]}toString(){return this._items.length?JSON.stringify(this._items,((e,t)=>t instanceof Error?String(t):t)):""}},we=_e(),window.addEventListener("beforeunload",me))}var ye,Ee,we,be=null;window.__VKCallsSDKLogs__=(e=!1)=>(ye||ve(),me(),ge(e));var Ce,Se,Te=((Ce=Te||{}).INIT="init",Ce.READY="ready",Ce.FRAME="frame",Ce.ERROR="error",Ce.DEBUG="debug",Ce.LOG_ERROR="log_error",Ce),De=class extends class{log(e,t,n=!1){}destroy(){}}{constructor(e,t){super(),this._batchInterval=3e3,this._batch=[],this._batchTimeout=null,this._api=e,this._externalLogger=t}_send(e){this._api.log(e)}_sendBatch(){this._stopTimeout(),this._batch.length>0&&(this._send(this._batch),this._batch=[],this._startTimeout())}_startTimeout(){this._batchTimeout=window.setTimeout((()=>this._sendBatch()),this._batchInterval)}_stopTimeout(){this._batchTimeout&&(clearTimeout(this._batchTimeout),this._batchTimeout=null)}_onUnload(){this._sendBatch(),this._stopTimeout()}log(e,t,n=!1){let r={};void 0!==t&&(r.param=t),this._logInternal(e,r,n),this._externalLogger&&this._externalLogger.log(e,t,n)}logCustom(e,t,n=!1){this._logInternal(e,t,n)}_logInternal(e,t,n){let r={type:1,time:0,operation:e,timestamp:Date.now(),custom:t,uid:this._api.getUserId()};this._batch.push(r),(n||!this._batchTimeout)&&this._sendBatch()}destroy(){this._sendBatch(),this._stopTimeout(),this._externalLogger&&this._externalLogger.destroy()}static create(e,t){De._instance||(De._instance=new De(e,t))}static log(e,t,n=!1){De._instance&&De._instance.log(e,t,n)}static logCustom(e,t,n=!1){De._instance&&De._instance.logCustom(e,t,n)}static destroy(){De._instance&&De._instance.destroy(),De._instance=null}},Pe=class{constructor(){this._worker=null}_createWorker(e,t){return v(this,arguments,(function*(e,t,n=[],r={},o=[]){return new Promise(((i,a)=>{let s=n.join(","),c=new Blob([e,`exports.default(${s});`],{type:"application/javascript; charset=utf-8"}),l=window.URL.createObjectURL(c);this._worker=new Worker(l),this._worker.onmessage=e=>{switch(e.data.type){case Te.READY:i();break;case Te.ERROR:a(e.data.error);break;case Te.FRAME:t(e.data);break;case Te.DEBUG:Gt.debug(e.data.message);break;case Te.LOG_ERROR:De.log(Z.ERROR,e.data.message)}},this._sendToWorker(Te.INIT,r,o)}))}))}_removeWorker(){var e;null==(e=this._worker)||e.terminate(),this._worker=null}_sendToWorker(e,t={},n=[]){var r;null==(r=this._worker)||r.postMessage(Object.assign({type:e},t),n)}static isBrowserSupported(){throw new Error("Not implemented")}},Ae=class extends Pe{init(e){return v(this,null,(function*(){Gt.debug("LibVPxDecoder started"),yield this._createWorker('var exports=(()=>{var y=Object.defineProperty;var E=a=>y(a,"__esModule",{value:!0});var M=(a,p)=>{E(a);for(var e in p)y(a,e,{get:p[e],enumerable:!0})};var D={};M(D,{default:()=>V});var t=(s=>(s.INIT="init",s.READY="ready",s.FRAME="frame",s.ERROR="error",s.DEBUG="debug",s.LOG_ERROR="log_error",s))(t||{});var V=(a,p)=>{let e=null,n=null,g=!0;function b(){return a({locateFile:p}).then(r=>n=r)}function s(r,m,l,R,x){if(!n){self.postMessage({type:t.LOG_ERROR,message:"decoder-init-fail-libvpx"}),self.postMessage({type:t.FRAME,error:"Fatal initialization error"});return}if(g!==l&&(g=l,e&&(e=null,self.postMessage({type:t.DEBUG,message:`LibVPxDecoder codec changed to ${l?"VP9":"VP8"} - reinitialize`}))),!e&&(self.postMessage({type:t.DEBUG,message:`LibVPxDecoder codec ${l?"VP9":"VP8"}`}),e=new n.VpxDecoder,e.debug(x),!e.init(l?n.VpxType.VP9:n.VpxType.VP8))){e=null,self.postMessage({type:t.FRAME,error:"Decoder failed to create"});return}try{e.allocateBuffer(m.byteLength).set(new Uint8Array(m))}catch(o){self.postMessage({type:t.DEBUG,message:o}),e=null,self.postMessage({type:t.FRAME,error:String(o)});return}if(!(e.decode()&&e.nextImage())){self.postMessage({type:t.FRAME,error:"Decode failed"});return}let d=e.getImageBuffer();if(!d){self.postMessage({type:t.FRAME,error:"No decoded data"});return}let c=e.getImageWidth(),f=e.getImageHeight();e.nextImage()&&(self.postMessage({type:t.DEBUG,message:"LibVPxDecoder dropped frame"}),self.postMessage({type:t.LOG_ERROR,message:"LibVPxDecoder-drop"}));let i=new Uint8ClampedArray(d.byteLength);if(i.set(d),R){let o=new ImageData(i,c,f);createImageBitmap(o,0,0,c,f).then(u=>{self.postMessage({type:t.FRAME,data:u},[u]),u.close()})}else self.postMessage({type:t.FRAME,data:i.buffer,width:c,height:f},[i.buffer])}b().then(()=>{self.onmessage=r=>{switch(r.data.type){case t.FRAME:s(r.data.timestamp,r.data.data,r.data.isVP9,r.data.useImageBitmap,r.data.debug);break}},self.postMessage({type:t.READY})}).catch(r=>{self.postMessage({type:t.ERROR,error:String(r)})})};return D;})();\n',(t=>{if(t.error)Gt.warn("LibVPxDecoder",t.error);else if(t.data instanceof ArrayBuffer){let n=new ImageData(new Uint8ClampedArray(t.data),t.width,t.height);e(n)}else e(t.data)}),[a(),a().getUrl])}))}decodeFrame(e,t,n,r){let o="ImageBitmap"in window;this._sendToWorker(Te.FRAME,{timestamp:e,data:t.buffer,isVP9:n,keyFrame:r,useImageBitmap:o,debug:Gt.enabled()},[t.buffer])}destroy(){this._removeWorker(),Gt.debug("LibVPxDecoder destroyed")}static isBrowserSupported(){return"WebAssembly"in window&&"Worker"in window}},ke=class extends Pe{init(e){return v(this,null,(function*(){Gt.debug("WebCodecsDecoder started"),yield this._createWorker('var exports=(()=>{var l=Object.defineProperty;var f=e=>l(e,"__esModule",{value:!0});var E=(e,d)=>{f(e);for(var a in d)l(e,a,{get:d[a],enumerable:!0})};var y={};E(y,{default:()=>g});var c=(a=>(a.VP9="vp09.00.50.08",a.VP8="vp8",a))(c||{}),o=(t=>(t.INIT="init",t.READY="ready",t.FRAME="frame",t.ERROR="error",t.DEBUG="debug",t.LOG_ERROR="log_error",t))(o||{});var g=()=>{let e=null,d=!0;function a(){self.postMessage({type:o.READY})}function p(r,m,t,n=!1){if(!e||d!==t){if(!n){self.postMessage({type:o.DEBUG,message:"WebCodecsDecoder dropped frame - waiting for keyframe"});return}d=t,e?self.postMessage({type:o.DEBUG,message:`WebCodecsDecoder codec changed to ${t?"VP9":"VP8"}`}):(self.postMessage({type:o.DEBUG,message:`WebCodecsDecoder codec ${t?"VP9":"VP8"}`}),e=new VideoDecoder({output:s=>{("createImageBitmap"in s?s.createImageBitmap():createImageBitmap(s)).then(i=>{self.postMessage({type:o.FRAME,data:i}),i.close()}).finally(()=>s.close())},error:s=>{e&&e.state!=="closed"&&e.close(),e=null,self.postMessage({type:o.FRAME,error:"WebCodecsDecoder failed, reinitialize"})}})),e.configure({codec:t?c.VP9:c.VP8})}let u=new EncodedVideoChunk({type:n?"key":"delta",timestamp:r,data:m});e.decode(u)}self.onmessage=r=>{switch(r.data.type){case o.INIT:a();break;case o.FRAME:p(r.data.timestamp,r.data.data,r.data.isVP9,r.data.keyFrame);break}}};return y;})();\n',(t=>{t.error?Gt.warn("WebCodecsDecoder",t.error):e(t.data)}))}))}decodeFrame(e,t,n,r=!1){this._sendToWorker(Te.FRAME,{timestamp:e,data:t.buffer,isVP9:n,keyFrame:r},[t.buffer])}destroy(){this._removeWorker(),Gt.debug("WebCodecsDecoder destroyed")}static isBrowserSupported(){return"VideoDecoder"in window&&"Worker"in window&&"VideoFrame"in window&&"ImageBitmap"in window&&"createImageBitmap"in window}},Ie="_okcls_",Oe=(()=>{try{let e=Date.now().toString(),t=window.localStorage,n=!1;return t.setItem(e,e),n=t.getItem(e)===e,t.removeItem(e),n?t:null}catch(e){return null}})();(e=>{e.get=function(e){return function(e){let t=Oe?Oe.getItem(Ie+e):null;if(null===t)return null;try{return JSON.parse(t)}catch(e){return null}}(e)||null},e.set=function(e,t){!function(e,t){try{Oe&&Oe.setItem(Ie+e,JSON.stringify(t))}catch(e){}}(e,t)},e.remove=function(e){!function(e){Oe&&Oe.removeItem(Ie+e)}(e)}})(Se||(Se={}));var xe=Se;function Re(e,t){if(e.isAudioEnabled!==t.isAudioEnabled||e.isVideoEnabled!==t.isVideoEnabled||e.isScreenSharingEnabled!==t.isScreenSharingEnabled||e.videoStreams.length!==t.videoStreams.length)return!1;for(let n of e.videoStreams)if(!t.videoStreams.find((e=>e.id===n.id&&e.source===n.source)))return!1;return!0}function Me(e){return Object.assign({isAudioEnabled:!1,isVideoEnabled:!1,isScreenSharingEnabled:!1,videoStreams:[]},e||{})}var Le,Ne=e=>e.stop(),Be=e=>e.getVideoTracks().forEach(Ne),Ue=class extends Error{constructor(e,t){super(),this.name="HangupReason",this.code=t&&t.code||0,this.remote=t&&t.remote||!1,Object.values(F).indexOf(e)>-1?this.hangup=e:this.error=e;let n=[];this.error&&n.push("error"),this.remote&&n.push("remote"),this.code&&n.push(`code: ${this.code}`),t&&t.message&&n.push(`message: '${t.message}'`),this.message=e+(n.length?` (${n.join(", ")})`:""),Error.captureStackTrace&&Error.captureStackTrace(this,Ue)}},Fe=(e=>(e.SOURCE_CHANGED="SOURCE_CHANGED",e.TRACK_REPLACED="TRACK_REPLACED",e.SCREEN_STATUS="SCREEN_STATUS",e))(Fe||{}),We=(e=>(e.audio="audio",e.video="video",e.screen="screen",e))(We||{}),je=class extends y{constructor(){super(),this._stream=null,this._trackVideoStreamBackup=null,this._screenTrack=null,this._sendVideoTrack=null,this._mediaSettings=Me(),this._videoStatusOnScreenCapturingEnabled=!1,this._effect=null,this._initDeviceChangeListener()}request(){return v(this,arguments,(function*(e=[j.AUDIO],t=!0){if(this._stream)return;let n=e.includes(j.VIDEO),r=e.includes(j.AUDIO);if(!Et.isBrowserSupported())throw new Ue(B.UNSUPPORTED);try{this._stream=yield Et.getUserMedia(n,r,t),this._mediaSettings.isVideoEnabled=n&&this._stream.getVideoTracks().filter((e=>e.enabled)).length>0||!1,this._mediaSettings.isAudioEnabled=r&&this._stream.getAudioTracks().filter((e=>e.enabled)).length>0||!1}catch(e){throw new Ue(e)}}))}getStream(){return this._stream}getScreenTrack(){return this._screenTrack}getSendVideoTrack(e=!1){return this._sendVideoTrack&&!e?this._sendVideoTrack:this._stream?this._stream.getVideoTracks()[0]:null}_getSendAudioTrack(){var e;return(null==(e=this._stream)?void 0:e.getAudioTracks()[0])||null}addTrackToPeerConnection(e,t=!1,n=!1){let r=this.getStream(),o=this._getSendAudioTrack(),i=this.getSendVideoTrack(n);if(!r||!o&&!i&&!t)throw new Error("No local stream found");o&&!t&&e.addTrack(o,r),i&&!t&&e.addTrack(i,r)}getMediaSettings(){return this._mediaSettings}changeDevice(e){return v(this,null,(function*(){switch(e){case"videoinput":return this._changeVideoInput();case"audioinput":return this._changeAudioInput();default:return Promise.reject()}}))}setVideoStream(e,t){return v(this,null,(function*(){return t?this._changeScreen(e):this._changeVideoInput(e)}))}_initDeviceChangeListener(){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices||!navigator.mediaDevices.addEventListener)return;let e=!1,t=!1,n=qe.throttle((()=>{t&&this._changeVideoInput().catch((()=>{})),e&&this._changeAudioInput().catch((()=>{})),e=!1,t=!1}),1e3);this._onDeviceChange=()=>v(this,null,(function*(){if(!this._stream)return;let r=this._stream.getAudioTracks()[0],o=r&&r.enabled&&r.getSettings(),i=o&&o.deviceId,a=this._stream.getVideoTracks()[0],s=a&&a.enabled&&a.getSettings(),c=s&&s.deviceId;if(!i&&!c)return;let l=yield navigator.mediaDevices.enumerateDevices();!e&&i&&(e=!l.find((e=>e.deviceId===i))),!t&&c&&(t=!l.find((e=>e.deviceId===c))),n()})),navigator.mediaDevices.addEventListener("devicechange",this._onDeviceChange)}_destroyDeviceChangeListener(){this._onDeviceChange&&navigator.mediaDevices.removeEventListener("devicechange",this._onDeviceChange)}_changeVideoInput(e=null){return v(this,null,(function*(){try{let t=e?"stream":"video",n=e||(yield Et.getUserVideo(void 0,!!this._effect));if(this._stream){Rt.consumerScreenTrack||this._disableScreenCapture();let e=this._getVideoEffectTrack(n),r=yield this._videoEffect(this._effect,e);this._stopLocalTrack("video"),De.log(Z.DEVICE_CHANGED,t),Gt.log("Video stream changed"),yield this._replaceLocalTrack(r),this._mediaSettings.isVideoEnabled=!0,this._triggerEvent("SOURCE_CHANGED",{kind:"video",mediaSettings:this._mediaSettings})}else n.getTracks().forEach((e=>e.stop()))}catch(e){throw De.log(Z.ERROR,"change_video"),Gt.warn("Camera change failed",e),e}}))}_getVideoEffectTrack(e){let t;return this._effect?(this._trackVideoStreamBackup||(this._trackVideoStreamBackup=e.getVideoTracks()[0].clone()),t=this._trackVideoStreamBackup.clone(),Be(e)):this._trackVideoStreamBackup?(t=this._trackVideoStreamBackup.clone(),this._stopAndRemoveTrackVideoStreamBackup(),Be(e)):t=e.getVideoTracks()[0],t}setAudioStream(e){return v(this,null,(function*(){return this._changeAudioInput(e)}))}_changeAudioInput(e=null){return v(this,null,(function*(){try{if(e=e||(yield Et.getUserAudio()),this._stream){let t=e.getAudioTracks()[0];this._stopLocalTrack("audio"),De.log(Z.DEVICE_CHANGED,"audio"),Gt.log("Audio stream changed"),yield this._replaceLocalTrack(t),this._mediaSettings.isAudioEnabled=!0,this._triggerEvent("SOURCE_CHANGED",{kind:"audio",mediaSettings:this._mediaSettings})}else e.getTracks().forEach((e=>e.stop()))}catch(e){throw De.log(Z.ERROR,"change_audio"),Gt.error("Microphone change failed",e),e}}))}_changeScreen(e){return v(this,null,(function*(){try{if((e=e||(yield Et.getScreenMedia())).addEventListener("inactive",(()=>{this._mediaSettings.isScreenSharingEnabled&&this.toggleScreenCapturing(!1)}),!1),this._stream){let t=e.getVideoTracks()[0],n=Rt.consumerScreenTrack?t:yield this._videoEffect(null,t);De.log(Z.DEVICE_CHANGED,"screen"),Gt.log("Screen capturing started"),this._screenTrack=n,this._mediaSettings.isScreenSharingEnabled=!0,Rt.consumerScreenTrack||(this._videoStatusOnScreenCapturingEnabled=this._mediaSettings.isVideoEnabled,this._mediaSettings.isVideoEnabled=!0,this._stopLocalTrack("video"),this._sendVideoTrack=Rt.consumerScreenDataChannel?Et.getBlackMediaTrack(Rt.videoMinWidth,Rt.videoMinHeight):n,yield this._replaceLocalTrack(n,this._sendVideoTrack)),this._triggerEvent("SCREEN_STATUS",{track:n,mediaSettings:this._mediaSettings}),this._triggerEvent("SOURCE_CHANGED",{kind:"screen",mediaSettings:this._mediaSettings})}else e.getTracks().forEach((e=>e.stop()))}catch(e){throw De.log(Z.ERROR,"screen"),Gt.warn("Screen capturing failed",e),e}}))}_disableScreenCapture(){this._sendVideoTrack&&(this._sendVideoTrack.stop(),this._sendVideoTrack=null),this._screenTrack&&(this._screenTrack.stop(),this._screenTrack=null),this._mediaSettings.isScreenSharingEnabled&&(this._mediaSettings.isScreenSharingEnabled=!1,this._triggerEvent("SCREEN_STATUS",{mediaSettings:this._mediaSettings}),this._triggerEvent("SOURCE_CHANGED",{kind:"screen",mediaSettings:this._mediaSettings}))}_replaceLocalTrack(e,t){return v(this,null,(function*(){!this._stream||this._stream.getTracks().forEach((n=>{var r,o;n.kind===e.kind&&(null==(r=this._stream)||r.removeTrack(n),null==(o=this._stream)||o.addTrack(e),this._triggerEvent("TRACK_REPLACED",e,t))}))}))}_stopLocalTrack(e){this._stream&&this._stream.getTracks().forEach((t=>{t.kind===e&&t.stop()}))}_videoEffect(e,t){return v(this,null,(function*(){if(!Rt.videoEffects)return t;try{return De.log(Z.DEVICE_CHANGED,`effect_${e}`),Rt.videoEffects.setEffect(e,t)}catch(e){return Gt.warn("Video effect failed",e),t}}))}_stopAndRemoveTrackVideoStreamBackup(){this._trackVideoStreamBackup&&(this._trackVideoStreamBackup.stop(),this._trackVideoStreamBackup=null)}destroy(){this._destroyDeviceChangeListener(),Rt.videoEffects&&(this._effect=null,Rt.videoEffects.destroy()),this._stream&&(this._stream.getTracks().forEach(Ne),this._stream=null),this._stopAndRemoveTrackVideoStreamBackup(),this._disableScreenCapture()}toggleScreenCapturing(e){return v(this,null,(function*(){return e?this._changeScreen():Rt.consumerScreenTrack?this._disableScreenCapture():this._videoStatusOnScreenCapturingEnabled?this._changeVideoInput():this.toggleVideo(!1)}))}toggleVideo(e){return v(this,null,(function*(){if(!this._stream)return;let t;if(Rt.consumerScreenTrack||this._disableScreenCapture(),e){let e=yield Et.getUserVideo(void 0,!!this._effect);t=this._getVideoEffectTrack(e),t=yield this._videoEffect(this._effect,t)}else t=Et.getBlackMediaTrack(Rt.videoMinWidth,Rt.videoMinHeight),t=yield this._videoEffect(null,t),this._stopAndRemoveTrackVideoStreamBackup();this._stopLocalTrack("video"),yield this._replaceLocalTrack(t),this._mediaSettings.isVideoEnabled=e,this._triggerEvent("SOURCE_CHANGED",{kind:"video",mediaSettings:this._mediaSettings})}))}toggleAudio(e){return v(this,null,(function*(){if(!this._stream)return;let t;t=e?(yield Et.getUserAudio()).getAudioTracks()[0]:Et.getSilentMediaTrack(),this._stopLocalTrack("audio"),yield this._replaceLocalTrack(t),this._mediaSettings.isAudioEnabled=e,this._triggerEvent("SOURCE_CHANGED",{kind:"audio",mediaSettings:this._mediaSettings})}))}setResolution(e,t){return v(this,null,(function*(){if(!Rt.consumerScreenTrack&&this._mediaSettings.isScreenSharingEnabled)return;if(!this._stream)throw new Error("Local stream not found");let n=this._stream.getVideoTracks()[0];if(!n)throw new Error("Local video track not found");if(n.enabled){if(!this._effect)return n.applyConstraints({width:{ideal:e},height:{ideal:t}});yield this.toggleVideo(!1),yield this.toggleVideo(!0)}}))}updateNoiseSuppression(){return v(this,null,(function*(){if(!this._stream||!this._mediaSettings.isAudioEnabled)return;let e=this._stream.getAudioTracks()[0];if(!e)throw new Error("Local audio track not found");return e.enabled?e.applyConstraints({noiseSuppression:Rt.noiseSuppression}):void 0}))}videoEffect(e){return v(this,null,(function*(){if(!Rt.videoEffects)throw new Error("Video Effects library is not set");if(!Rt.consumerScreenTrack&&this._mediaSettings.isScreenSharingEnabled)throw new Error("Can't apply effect to screensharing");if(this._mediaSettings.isVideoEnabled)return this._stream&&e!==this._effect?(this._effect=e,this._changeVideoInput(this._stream)):void 0;this._effect=e}))}},Ve=":";(e=>{e.patchSDP=function(e,t,n,r,o=!1){let i=/[\r\n]+/,a="\r\n";if(!t&&!n&&!r)return o?s(e.split(i)).join(a):e;function s(e){let t=e.findIndex((e=>e.startsWith("a=rtcp-fb:111")));return~t&&(e[t]=e[t]+a+["a=rtcp-fb:111 nack","a=rtcp-fb:111 nack pli"].join(a)),e}function c(e,t,n){let r,o=e.split(" "),i=o.slice(0,3);for(r=3;r<o.length;r++)n.includes(o[r])&&i.push(o[r]);for(r=3;r<o.length;r++)!n.includes(o[r])&&!t.includes(o[r])&&i.push(o[r]);return i.join(" ")}function l(e,t){let n,r=new RegExp("a=rtpmap:(\\d+) ([a-zA-Z0-9-]+)\\/\\d+"),o=[];for(n=0;n<e.length;++n){let i=e[n].match(r);i&&3===i.length&&i[2]===t&&o.push(i[1])}return o}function u(e,t,n,r){let o,i="m="+t;for(o=0;o<e.length;++o)if(e[o].startsWith(i)){e[o]=c(e[o],n,r);break}}let d=[],_=e.split(i);(n||t)&&(d=l(_,"H264"));let p=[];if(r&&(p=l(_,"VP9")),n){let e,t=d.slice(0),n=new RegExp("a=fmtp:(\\d+) apt=(\\d+)");for(e=0;e<_.length;++e){let r=_[e].match(n);r&&3===r.length&&t.includes(r[2])&&t.push(r[1])}let r=new RegExp("a=(rtpmap|rtcp-fb|fmtp):(\\d+) .*");for(e=_.length;e--;){let n=_[e].match(r);n&&3===n.length&&t.includes(n[2])&&_.splice(e,1)}u(_,"video",t,[])}else t&&u(_,"video",[],d);return r&&u(_,"video",[],p),o&&s(_),_.join(a)},e.getPeerIdString=function(e){return e?`${e.type||"WEB_SOCKET"}_${e.id}`:"_"},e.comparePeerId=function(e,t){return e&&e.id===t.id&&(e.type||"WEB_SOCKET")===(t.type||"WEB_SOCKET")},e.getPeerConnectionHostInfo=function(e){return v(this,null,(function*(){return e&&e.getStats?e.getStats(null).then((e=>{let t=null,n=null;if(e.forEach((t=>{"transport"===t.type&&t.selectedCandidatePairId?n=e.get(t.selectedCandidatePairId):"candidate-pair"===t.type&&"succeeded"===t.state&&!n&&(!t.hasOwnProperty("selected")||t.selected)&&(n=t)})),n&&n.localCandidateId){let r=e.get(n.localCandidateId);r&&(t={type:r.candidateType,ip:r.ip||r.ipAddress,port:r.port||r.portNumber})}return t})).catch((()=>null)):Promise.resolve(null)}))};let t=/^[0-9]+$/,n=/^([gu])([0-9]+)$/;function r(e,r){let o=String(e);return n.test(o)?(Gt.warn(`Already composite id [${e}] type supplied [${r}]`),o):r===ce.GROUP?"g"+o:r===ce.USER?"u"+o:(Gt.warn(`Unknown type [${r}] for id [${e}]`),o.match(t)?"u"+o:o)}function o(e,t,n){return i(r(e,t),n)}function i(e,t){return t?e+Ve+"d"+t:e}function a(e){return o(e.id,e.idType||ce.USER,e.deviceIdx||0)}function s(e,t,n,r,o){if(e&&n&&n.kind===We.video){let i=n.getSettings();if(i){let a=e.maxBitrateK?1024*e.maxBitrateK:null,s=i.width,c=i.height,l=s&&c&&e.maxDimension?Math.max(1,Math.max(s,c)/e.maxDimension):null,u=e.maxFramerate?e.maxFramerate:null,d=e.degradationPreference?e.degradationPreference:"balanced",_=r[n.id];if(_&&_.bitrate===a&&_.scaleResolutionDownBy===l&&_.maxFramerate===u&&_.degradationPreference===d)return void(o[n.id]=_);o[n.id]={bitrate:a,scaleResolutionDownBy:l,maxFramerate:u,degradationPreference:d};let p=t.getParameters();p.encodings||(p.encodings=[{}]),p.encodings.forEach((e=>{a?e.maxBitrate=a:delete e.maxBitrate,l?e.scaleResolutionDownBy=l:delete e.scaleResolutionDownBy,u?e.maxFramerate=u:delete e.maxFramerate})),p.degradationPreference=d,t.setParameters(p)}}}e.composeUserId=r,e.composeParticipantId=o,e.compose=i,e.composeId=a,e.composeMessageId=function(e){return e.participant?a(e.participant):o(e.participantId,e.participantType||ce.USER,e.deviceIdx||0)},e.decomposeId=function(e){let t=String(e),r=t.match(n);return r?{id:Number(r[2]),type:"g"===r[1]?ce.GROUP:ce.USER}:(Gt.warn(`Unsupported compositeId [${e}]`),{id:Number(t),type:ce.USER})},e.decomposeParticipantId=function(e){let t=e.split(":d");return{compositeUserId:t[0],deviceIdx:t.length>1?parseInt(t[1],10):0}},e.uuid=function(){var e,t;let n=null==(t=null==(e=window.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if(n)return n;let r,o,i="0123456789abcdefghijklmnopqrstuvwxyz".split(""),a=new Array(36),s=0;for(o=0;o<36;o++)8===o||13===o||18===o||23===o?a[o]="-":14===o?a[o]="4":(s<=2&&(s=33554432+16777216*Math.random()|0),r=15&s,s>>=4,a[o]=i[19===o?3&r|8:r]);return a.join("")},e.throttle=function(e,t){let n;return function(){let r=this,o=arguments;n&&window.clearTimeout(n),n=window.setTimeout((()=>{e.apply(r,o)}),t)}},e.sdpFingerprint=function(e){let t="",n=e.split("\n");for(let e of n)if(e.startsWith("a=fingerprint")){let n=e.split(" ");if(2===n.length){t=n[1];break}}if(!t)return c().minusOne;let r=t.split(":"),o=c().zero;for(let e=Math.min(7,r.length-1);e>=0;e--){let t=c()(r[e],16);o=o.shiftLeft(8).or(t)}return((e,t)=>{let n=t.value;if("bigint"==typeof n)return c()(BigInt.asIntN(64,n));let r=c().one.shiftLeft(64),o=t.and(r.subtract(1));return o.greaterOrEquals(r.subtract(o))?o.subtract(r):o})(0,o)},e.delay=function(e){return v(this,null,(function*(){return new Promise((t=>window.setTimeout(t,e)))}))},e.applySettings=function(e,t,n){let r=[];return e.getSenders().forEach((e=>s(t,e,e.track,n,r))),r},e.applyVideoTrackSettings=s,e.includesOneOf=function(e,t){Array.isArray(t)||(t=[t]);for(let n of t)if(e.includes(n))return!0;return!1},e.mapParticipantState=function(e){var t;return Object.entries((null==(t=e.participantState)?void 0:t.state)||{}).reduce(((t,[n,r])=>(e.participantState&&(t[n]={ts:e.participantState.stateUpdateTs[n],state:r}),t)),{})},e.mapLegacyParticipantState=function(e){return Object.entries(e).reduce(((e,[t,{state:n}])=>(e[t]=n,e)),{})},e.mapSharedParticipants=function(e){return e.map((e=>{let t={uid:e.externalId,mediaSettings:e.mediaSettings,status:e.status,muteStates:e.muteStates,unmuteOptions:e.unmuteOptions};return Rt.participantStateMapped&&(t.participantState=e.participantState),t}))},e.isEqualParticipantState=function(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!r.hasOwnProperty(o)||e[o].state!==t[o].state||e[o].ts!==t[o].ts)return!1;return!0},e.isObjectsEquals=function(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||e[r]!==t[r])return!1;return!0},e.isArraysEquals=function(e,t){if(e.length!==t.length)return!1;for(let n of e)if(t.indexOf(n)<0)return!1;return!0},e.isEmptyObject=function(e){return!Object.keys(e).length}})(Le||(Le={}));var He,Ke,Ge,ze,qe=Le,$e=null,Ye=null,Qe=[],Xe=[],Je=[],Ze=null,et=null,tt=null,nt=!1,rt=!1,ot=!1,it=!1,at=null,st="",ct=[],lt=null,ut=navigator.appVersion,dt=navigator.appName,_t=navigator.userAgent,pt=(e=>(e.USER="user",e.ENVIRONMENT="environment",e.LEFT="left",e.RIGHT="right",e))(pt||{}),ht=class{constructor(e,t=!1,n=Rt.videoMaxWidth,r=Rt.videoMaxHeight){let o=!1;if(e){let t;o={noiseSuppression:Rt.noiseSuppression,echoCancellation:!0,autoGainControl:!0},et&&(t=et.deviceId),"string"==typeof e&&(t=e),t&&(o.deviceId={ideal:t})}let i=!1;if(t){let e;i={width:{min:Rt.videoMinWidth,max:n,ideal:n},height:{min:Rt.videoMinHeight,max:r,ideal:r},aspectRatio:{ideal:Rt.videoAspectRatio},frameRate:{ideal:Rt.videoFrameRate}},Ze&&(e=Ze.deviceId),"string"==typeof t&&(e=t),e&&(i.deviceId={ideal:e}),Rt.videoFacingMode&&(i.facingMode={ideal:Rt.videoFacingMode})}this.audio=o,this.video=i,this.needVideo=!!i}getNative(){return Object.assign({},{audio:this.audio,video:this.video})}simplify(){return"object"==typeof this.video&&(this.video.width||this.video.height?(delete this.video.width,delete this.video.height):this.video.aspectRatio?delete this.video.aspectRatio:this.video.frameRate?delete this.video.frameRate:(this.video.deviceId||this.video.facingMode)&&(delete this.video.deviceId,delete this.video.facingMode)),"object"==typeof this.audio&&(this.audio.echoCancellation||this.audio.autoGainControl||this.audio.noiseSuppression?(delete this.audio.echoCancellation,delete this.audio.autoGainControl,delete this.audio.noiseSuppression):this.audio.deviceId&&delete this.audio.deviceId),!0===this.video&&!0===this.audio?this.video=!1:!1===this.video&&!0===this.audio?(this.audio=!1,this.video=this.needVideo):!0===this.video&&!1===this.audio&&(this.video=!1),this.video&&!Object.keys(this.video).length&&(this.video=!0),this.audio&&!Object.keys(this.audio).length&&(this.audio=!0),this}canSimplify(){let e="object"==typeof this.video&&(this.video.width||this.video.height||this.video.aspectRatio||this.video.frameRate||this.video.facingMode||this.video.deviceId)||this.video;return!!("object"==typeof this.audio&&(this.audio.deviceId||this.audio.noiseSuppression||this.audio.echoCancellation||this.audio.autoGainControl)||this.audio||e)}isVideo(){return!!this.video}isAudio(){return!!this.audio}},ft=class extends ht{constructor(e,t){super(!1,!0),"object"==typeof this.video?(delete this.video.deviceId,delete this.video.aspectRatio,delete this.video.frameRate,delete this.video.facingMode):this.video={},this.video.cursor="motion",this.video.width=e,this.video.height=t,this.video.frameRate=Rt.screenFrameRate}};function mt(){$e=null,gt().then((()=>jt.onDeviceChange()))}function gt(){return v(this,null,(function*(){return $e||(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?(!Ye&&navigator.mediaDevices.addEventListener&&(Ye=qe.throttle(mt,1e3),navigator.mediaDevices.addEventListener("devicechange",Ye)),$e=navigator.mediaDevices.enumerateDevices().then((e=>{Qe=e.filter((e=>"videoinput"===e.kind&&(e.label&&(nt=!0),!0))),Xe=e.filter((e=>"audioinput"===e.kind&&(e.label?rt=!0:ze.isMobile()&&"Firefox"===ze.browserName()&&(rt=nt),!0))),Je=e.filter((e=>"audiooutput"===e.kind));let t=xe.get("videoinput"),n=xe.get("audioinput"),r=xe.get("audiooutput");return Ze=Qe.find((e=>e.deviceId===t))||null,et=Xe.find((e=>e.deviceId===n))||null,tt=Je.find((e=>e.deviceId===r))||null,$e=Promise.resolve(e),e})).catch((()=>($e=null,[])))):[])}))}function vt(e,t){return v(this,null,(function*(){Gt.debug("Try to get media",e.getNative());let n=ze.hasPermissions(e.isVideo());!n&&!t&&jt.onPermissionsRequested();try{let t=yield navigator.mediaDevices.getUserMedia(e.getNative());return n||(yield function(){return v(this,null,(function*(){$e=null,yield gt()}))}()),t}catch(n){switch(n.name){case"PermissionDeniedError":case"PermissionDismissedError":case"NotAllowedError":case"SecurityError":case"DOMException":t=e.isVideo()?B.CAMERA_PERMISSION:B.MIC_PERMISSION;break;case"OverconstrainedError":case"TypeError":case"NotFoundError":break;case"AbortError":case"NotReadableError":t=e.isVideo()?B.CAMERA_ACCESS:B.MIC_ACCESS}if(e.canSimplify())return vt(e.simplify(),t);let r=t||B.UNKNOWN;throw jt.onPermissionsError(r),r}}))}function yt(){return ct.length||(ct=(()=>{let e,t=!1,n=0,r="0",o=_t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(o[1]))return e=/\brv[ :]+(\d+)/g.exec(_t),["IE",e&&e[1]||"Unknown",t,n,r];if("Safari"===o[1]){if(e=_t.match(/\bEdge\/(\d+)/),e)return["Edge",e[1]||"Unknown",t,n,r];if(e=_t.match(/\bCriOS\/(\d+)/),e)return["Chrome",e[1],!0,Number(e[1]),r];if(e=_t.match(/\bFxiOS\/(\d+)/),e)return["Firefox",e[1],!1,n,r];if(e=_t.match(/\bYaBrowser\/(\d+)/),e)return["Yandex",e[1],!1,n,r];if(e=_t.match(/\bOPT\/(\d+)/),e)return["Opera",e[1],!1,n,r]}if("Chrome"===o[1]){if(t=!0,n=Number(o[2]),e=_t.match(/\bOPR\/(\d+)/),e)return["Opera",e[1]||"Unknown",t,n,r];if(e=_t.match(/\bYaBrowser\/(\d+)/),e)return["Yandex",e[1]||"Unknown",t,n,r];if(e=_t.match(/\bSferum\/((\d+)(?:\.\d+)*)/),e)return["Sferum",e[1]||"Unknown",t,n,r];if(e=_t.match(/\bEdge?\/(\d+)/),e)return["Edge",e[1]||"Unknown",t,n,r];if(void 0!==window.opr&&/^(.+\.)?ok.ru$/.test(window.location.host))return["Opera","Hidden",t,n,r]}return e=_t.match(/version\/(\d+)(?:(?:\.)(\d+))?/i),e&&void 0!==e[2]&&(r=e[2]),[o[2]?o[1]:dt,e&&e[1]||o[2]||ut,t,n,r]})()),ct}(e=>{function t(){return Qe.length>0}function n(){return Xe.length>0}function r(){return nt}function o(){return rt}function i(){if(!Ge||"ended"===Ge.readyState){let e=l(),t=e.createMediaStreamDestination(),n=e.createGain();n.gain.value=1e-5,n.connect(t),n.connect(e.destination);let r=e.createOscillator();r.type="sine",r.frequency.value=0,r.connect(n),r.start(),Ge=t.stream.getAudioTracks()[0]}return Object.assign(Ge.clone(),{enabled:!1})}function a(e=Rt.videoMinWidth,t=Rt.videoMinHeight){return Ke||(Ke=document.createElement("canvas")).getContext("2d"),Ke.width=e,Ke.height=t,(!He||"ended"===He.readyState)&&(He=Ke.captureStream(Rt.videoFrameRate).getVideoTracks()[0]),Object.assign(He.clone(),{enabled:!1})}function s(){return yt()[0]}function c(){return yt()[1]}function l(){return lt||(lt=new(window.AudioContext||window.webkitAudioContext)),lt}e.init=function(){return v(this,null,(function*(){return yield function(){return v(this,null,(function*(){return ze.isBrowserSupported()?new Promise((e=>{(new window.RTCPeerConnection).createOffer({offerToReceiveVideo:!0}).then((t=>{/^a=rtpmap:\d+ VP8\/\d+$/m.test(t.sdp)&&(ot=!0),/^a=mid:0$/m.test(t.sdp)&&(it=!0),e()})).catch(e)})):Promise.resolve()}))}(),gt()}))},e.getCameras=function(){return Qe},e.getMicrophones=function(){return Xe},e.getOutput=function(){return Je},e.hasCamera=t,e.hasMicrophone=n,e.getSavedCamera=function(){return Ze},e.getSavedMicrophone=function(){return et},e.getSavedOutput=function(){return tt},e.hasCameraPermission=r,e.hasMicrophonePermission=o,e.hasPermissions=function(e=!1){return!!o()&&(!t()||!e||r())},e.getUserMedia=function(e=!1,r=!0,o=!0){return v(this,null,(function*(){let s,c=n()&&r,l=t()&&e;if(c||l)try{s=yield vt(new ht(c,l))}catch(e){s=new MediaStream}else s=new MediaStream;return!s.getVideoTracks().length&&o&&s.addTrack(a()),!s.getAudioTracks().length&&o&&s.addTrack(i()),s}))},e.getScreenMedia=function(){return v(this,null,(function*(){return function(e){return v(this,null,(function*(){Gt.debug("Try to get screen",e.getNative());try{let t=yield navigator.mediaDevices.getDisplayMedia(e.getNative()),n=null==t?void 0:t.getVideoTracks()[0];return n&&(Gt.debug("Got display media track",n.id),n.contentHint="text"),t}catch(e){switch(e.name){case"PermissionDeniedError":case"NotAllowedError":case"SecurityError":throw B.SCREEN_PERMISSION;default:throw B.SCREEN_ACCESS}}}))}(new ft(window.screen.width,window.screen.height))}))},e.getUserVideo=function(e,t=!1){return v(this,null,(function*(){let n=t?Rt.videoEffectMaxWidth:Rt.videoMaxWidth,r=t?Rt.videoEffectMaxHeight:Rt.videoMaxHeight;return vt(new ht(!1,e||!0,n,r))}))},e.getUserAudio=function(e){return v(this,null,(function*(){return vt(new ht(e||!0,!1))}))},e.saveDeviceId=function(e,t){return v(this,null,(function*(){let n=(yield gt()).find((n=>n.kind===e&&n.deviceId===t));return n?("videoinput"===e?Ze=n:"audioinput"===e?et=n:"audiooutput"===e&&(tt=n),xe.set(e,t),n):null}))},e.getSilentMediaTrack=i,e.getBlackMediaTrack=a,e.isBrowserSupported=function(){if("Edge"===s()&&Number(c())<70)return!1;try{let e=window;return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&e.RTCPeerConnection&&e.RTCIceCandidate&&e.RTCSessionDescription&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.captureStream&&e.RTCRtpSender&&e.RTCRtpSender.prototype.replaceTrack&&e.RTCRtpSender.prototype.getParameters&&navigator.sendBeacon)}catch(e){return!1}},e.isScreenCapturingSupported=function(){return!!navigator.mediaDevices.getDisplayMedia},e.canVP8=function(){return ot},e.isUnifiedPlan=function(){return it},e.isBrokenH264=function(){let t="Safari"===e.browserName()&&"15"===e.browserVersion()&&"1"===e.browserSubVersion(),n="Opera"===e.browserName()&&"Windows"===e.os();return t||n},e.canPreferH264=function(){return!(e.baseChromeVersion()&&e.isMobile())},e.os=function(){return st||(st=(()=>{let e={Windows:/Win/,Android:/Android/,OpenBSD:/OpenBSD/,SunOS:/SunOS/,Linux:/(Linux|X11)/,iPad:/(iPad)/,iPhone:/(iPhone)/,iPod:/(iPod)/,MacOS:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/,QNX:/QNX/,UNIX:/UNIX/,BeOS:/BeOS/,OS2:/OS\/2/,Bot:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/};for(let t in e)if(e.hasOwnProperty(t)&&e[t].test(_t))return t;return"Unknown"})()),st},e.isMobile=function(){return null===at&&(at=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(ut)),at},e.browserName=s,e.browserVersion=c,e.baseChromeVersion=function(){return yt()[3]},e.getAudioContext=l,e.browserSubVersion=function(){return yt()[4]}})(ze||(ze={}));var Et=ze,wt=class{constructor(e,t){this._chunks=[],this._participantId=e,this._onStream=t}appendChunk(e){let t=this._chunks.length;if(e.start)t&&(Gt.warn("[FrameBuilder] Cleanup buffer",Array.prototype.slice.call(this._chunks)),this._chunks=[]);else if(!t||(this._chunks[t-1].sequence+1)%65536!==e.sequence)return void Gt.warn("[FrameBuilder] Got incorrect chunk");if(this._chunks.push(e),e.end){let t=this._processFrameData(),{width:n,height:r}=wt.getFrameSize(t);this._processFrame({timestamp:e.timestamp,frameData:t,isVP9:e.isVP9,keyframe:e.keyframe,width:n,height:r})}}destroy(){this._chunks=[]}_processFrameData(){let e=this._chunks;this._chunks=[];let t=e.reduce(((e,t)=>e+t.data.byteLength),0),n=new Uint8Array(t),r=0;for(let t of e)n.set(new Uint8Array(t.data),r),r+=t.data.byteLength;return n}static getFrameSize(e){let t={width:0,height:0},n=new l.BitStream(e.buffer);n.bigEndian=!0,n.index+=2;let r=n.readBits(1),o=n.readBits(1)<<1|r;return 3===o&&n.index++,1===n.readBits(1)||0!==n.readBits(1)||(n.index++,n.index++,n.index+=24,o>=2&&n.index++,7!==n.readBits(3)?(n.index++,(1===o||3===o)&&(n.index+=3)):(1===o||3===o)&&n.index++,t.width=n.readBits(16)+1,t.height=n.readBits(16)+1),t}static isBrowserSupported(){throw new Error("Method `isBrowserSupported` is not implemented")}},bt=class extends wt{constructor(e,t){super(e,t),this._decoderReady=!1,this._decoderQueue=[],this._canvas=null,this._canvasContext=null,this._stream=null,this._track=null,Gt.debug(`StreamBuilder started for participant [${e}]`),this._useImageBitmap="ImageBitmap"in window,ke.isBrowserSupported()?this._decoder=new ke:this._decoder=new Ae,this._decoder.init((e=>this._drawImage(e))).then((()=>{this._decoderReady=!0,this._decodeQueue()}))}_createStream(e,t){this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.width=e,this._canvas.height=t,this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden",this._canvas.style.position="absolute",this._canvas.style.width="160px",this._canvas.style.height="90px",this._canvas.style.bottom="0",this._canvas.style.right="0",this._canvas.style.zIndex="5000",document.body.appendChild(this._canvas),this._useImageBitmap?this._canvasContext=this._canvas.getContext("bitmaprenderer"):this._canvasContext=this._canvas.getContext("2d"),this._stream=this._canvas.captureStream(0),this._track=this._stream.getVideoTracks()[0],this._track.contentHint="text")}_removeStream(){this._stream&&(this._stream.getTracks().forEach((e=>e.stop())),this._stream=null,this._track=null),this._canvasContext=null;try{this._canvas&&document.body.removeChild(this._canvas)}catch(e){}this._canvas=null}_requestCanvasFrame(){this._track&&this._track.requestFrame?this._track.requestFrame():this._stream&&this._stream.requestFrame&&this._stream.requestFrame()}_drawImage(e){this._track||(this._createStream(e.width,e.height),this._onStream(this._stream));let t=this._canvas;if(t.width=e.width,t.height=e.height,e instanceof ImageData){let n=this._canvasContext;n.clearRect(0,0,t.width,t.height),n.putImageData(e,0,0)}else this._canvasContext.transferFromImageBitmap(e);this._requestCanvasFrame()}_processFrame(e){!this._decoderReady||this._decoderQueue.length?(this._decoderQueue.push(e),this._decodeQueue()):this._decoder.decodeFrame(e.timestamp,e.frameData,e.isVP9,e.keyframe)}_decodeQueue(){if(!this._decoderReady)return;let e=this._decoderQueue;this._decoderQueue=[],e.forEach((e=>{this._decoder.decodeFrame(e.timestamp,e.frameData,e.isVP9,e.keyframe)}))}destroy(){super.destroy(),this._decoder.destroy(),this._removeStream(),Gt.debug(`StreamBuilder destroyed for participant ${this._participantId}`)}static isBrowserSupported(){return("CanvasCaptureMediaStream"in window||"CanvasCaptureMediaStreamTrack"in window)&&!("Safari"===Et.browserName()&&Number(Et.browserVersion())>=15)}};var Ct=m(2,15)-1,St=class{constructor(e){this._queue=[],this._clearBufferTill=0,this._mediaSource=new MediaSource,this._codec=e;let t=()=>{this._mediaSource.removeEventListener("sourceopen",t),this._initBuffer(),this._handleQueue()};this._mediaSource.addEventListener("sourceopen",t,!1)}_handleQueue(){if(!this._sourceBuffer||this._sourceBuffer.updating||!this._queue.length)return;if(this._clearBufferTill&&this._sourceBuffer.buffered.length){let e=this._sourceBuffer.buffered.start(0);return e<this._clearBufferTill&&(this._sourceBuffer.remove(e,this._clearBufferTill),Gt.debug(`[WebmBuilder] SourceBuffer cleanup from ${e} to ${this._clearBufferTill}`)),void(this._clearBufferTill=0)}let e=this._queue;this._queue=[];let t=St._buildQueue(e);this._sourceBuffer.appendBuffer(t)}static _buildQueue(e){if(!e.length)return new Uint8Array;if(1===e.length)return u.build(e[0]);let t=e.reduce(((e,t)=>e+t.countSize()),0),n=new Uint8Array(t),r=0;for(let t of e){let e=u.build(t);n.set(e,r),r+=e.byteLength}return n}_initBuffer(){this._sourceBuffer=this._mediaSource.addSourceBuffer(`video/webm; codecs="${this._codec}"`),this._sourceBuffer.mode="sequence",this._sourceBuffer.addEventListener("updateend",(()=>this._handleQueue()))}changeType(e){var t;return this._codec=e,null==(t=this._sourceBuffer)?void 0:t.changeType(e)}append(e,t=!1){this._queue.push(e),t&&this._handleQueue()}cleanup(){var e,t,n;"open"===(null==(e=this._mediaSource)?void 0:e.readyState)&&(null==(t=this._sourceBuffer)||t.abort());let r=null==(n=this._sourceBuffer)?void 0:n.buffered,o=null==r?void 0:r.length;if(!o)return;let i=r.start(0),a=Math.max(0,r.end(o-1)-5);a-i>5&&(this._clearBufferTill=a)}destroy(){this._queue=[],"open"===this._mediaSource.readyState&&(this._sourceBuffer.abort(),this._mediaSource.endOfStream()),this._sourceBuffer=null,this._clearBufferTill=0}get codec(){return this._codec}get mediaSource(){return this._mediaSource}get buffered(){var e;return null==(e=this._sourceBuffer)?void 0:e.buffered}},Tt=class extends wt{constructor(e,t){super(e,t),this._video=null,this._stream=null,this._earliestTimestamp=0,this._clusterStartTime=0,this._lastFrameTimestamp=0,Gt.debug(`[WebmBuilder] started for participant [${e}]`)}static _intToU16BE(e){return new Uint8Array([e>>8,e])}static _genWebmHeader(){return u.element(u.ID.EBML,[u.element(u.ID.EBMLVersion,u.number(1)),u.element(u.ID.EBMLReadVersion,u.number(1)),u.element(u.ID.EBMLMaxIDLength,u.number(4)),u.element(u.ID.EBMLMaxSizeLength,u.number(8)),u.element(u.ID.DocType,u.string("webm")),u.element(u.ID.DocTypeVersion,u.number(2)),u.element(u.ID.DocTypeReadVersion,u.number(2))])}static _genSegmentHeader(e,t,n){let r=u.element(u.ID.Info,[u.element(u.ID.TimecodeScale,u.number(1e6)),u.element(u.ID.MuxingApp,u.string("vk-webm-builder")),u.element(u.ID.WritingApp,u.string("vk-webm-builder"))]),o=[u.element(u.ID.PixelWidth,u.number(e)),u.element(u.ID.PixelHeight,u.number(t))],i=u.element(u.ID.Tracks,u.element(u.ID.TrackEntry,[u.element(u.ID.TrackNumber,u.number(1)),u.element(u.ID.TrackUID,u.number(1)),u.element(u.ID.TrackType,u.number(1)),u.element(u.ID.FlagLacing,u.number(0)),u.element(u.ID.DefaultDuration,u.number(1e9)),u.element(u.ID.CodecID,u.string(`V_${n.toUpperCase()}`)),u.element(u.ID.Video,o)]));return u.unknownSizeElement(u.ID.Segment,[r,i])}static _genClusterHeader(e){return u.unknownSizeElement(u.ID.Cluster,[u.element(u.ID.Timecode,u.number(Math.round(e)))])}_createVideo(e){this._mediaBuffer=new St(e),this._video=document.createElement("video"),this._video.autoplay=!0,this._video.controls=!1,this._video.muted=!0,this._video.style.pointerEvents="none",this._video.style.visibility="hidden",this._video.style.position="absolute",this._video.style.width="160px",this._video.style.height="90px",this._video.style.bottom="0",this._video.style.right="0",this._video.style.zIndex="5000",this._video.src=URL.createObjectURL(this._mediaBuffer.mediaSource),document.body.appendChild(this._video);let t=()=>{if(this._video.src){Gt.warn(`[WebmBuilder] Video paused for participant [${this._participantId}], try to play again`);let e=this._video.seekable;e.length&&(this._video.currentTime=e.end(e.length-1)-.1),this._video.play().catch((()=>{}))}};this._video.onpause=t,this._video.onwaiting=t,this._video.onstalled=t,this._video.onerror=()=>Gt.warn(`[WebmBuilder] Video Error for participant [${this._participantId}]`,this._video.error),this._stream=this._video.captureStream(),this._onStream(this._stream)}_processFrame(e){let t=e.isVP9?"vp9":"vp8";this._mediaBuffer?this._mediaBuffer.codec!==t&&this._mediaBuffer.changeType(t):this._createVideo(t);let n=e.timestamp;if(n<=this._lastFrameTimestamp&&(n=this._lastFrameTimestamp+10,Gt.debug(`[WebmBuilder] Fixup timestamp for participant [${this._participantId}]`)),this._lastFrameTimestamp=n,this._earliestTimestamp)n-=this._earliestTimestamp;else{if(!e.keyframe)return;this._earliestTimestamp=n,n=0}if(e.keyframe){this._clusterStartTime=n,this._mediaBuffer.cleanup(),Gt.debug(`[WebmBuilder] Segment header for participant [${this._participantId}]`);let r=Tt._genWebmHeader();this._mediaBuffer.append(r);let o=Tt._genSegmentHeader(e.width,e.height,t);this._mediaBuffer.append(o)}let r=Math.round(n-this._clusterStartTime);if(r>Ct&&(this._clusterStartTime=n,r=0),0===r){Gt.debug(`[WebmBuilder] Cluster header for participant [${this._participantId}]`);let e=Tt._genClusterHeader(this._clusterStartTime);this._mediaBuffer.append(e)}let o=u.element(u.ID.SimpleBlock,[u.vintEncodedNumber(1),u.bytes(Tt._intToU16BE(r)),u.number((e.keyframe?1:0)<<7),u.bytes(e.frameData)]);this._mediaBuffer.append(o,!0)}destroy(){super.destroy(),this._video&&(this._video.onpause=null,this._video.onwaiting=null,this._video.onstalled=null,this._video.onerror=null,this._video.pause(),this._video.src="",document.body.removeChild(this._video)),this._mediaBuffer&&(this._mediaBuffer.destroy(),this._mediaBuffer=null),this._stream&&(this._stream.getTracks().forEach((e=>e.stop())),this._stream=null),Gt.debug(`[WebmBuilder] destroyed for participant [${this._participantId}]`)}static isBrowserSupported(){var e,t,n;return"captureStream"in(null==(e=window.HTMLVideoElement)?void 0:e.prototype)&&(null==(t=window.MediaSource)?void 0:t.isTypeSupported('video/webm; codecs="vp8"'))&&(null==(n=window.MediaSource)?void 0:n.isTypeSupported('video/webm; codecs="vp9"'))}},Dt=class{constructor(e,t,n,r){this._participantIdRegistry=null,this._streamBuilders={},this._onStream=()=>{},this._onEos=()=>{},Gt.debug("ScreenCaptureReceiver started"),this._datachannel=e,this._participantIdRegistry=t,this._onStream=n,this._onEos=r,this._datachannel.onmessage=e=>this._onDataChannelMessage(e.data)}_onDataChannelMessage(e){var t,n;let r=function(e){let t=new DataView(e),n=t.getUint8(0),r=t.getUint16(1),o=t.getUint32(3),i=1===t.getUint8(7),a=t.getUint16(8),s=t.getUint8(10),c=!!(1&s),l=!!(2&s),u=!!(4&s),d=!!(8&s);if(1!==n)throw new Error(`Unexpected protocol version. Got ${n}, expected 1`);return{timestamp:o,start:c,end:l,keyframe:u,sequence:r,isVP9:i,ssrc:a,eos:d,data:e.slice(11)}}(e),o=null==(n=null==(t=this._participantIdRegistry)?void 0:t.getStreamDescription(r.ssrc))?void 0:n.participantId;if(!o)return void Gt.warn(`Participant id for ssrc ${r.ssrc} not found in registry`);if(r.eos)return this.close(o),void this._onEos(o);let i=this._streamBuilders[o];if(!i){let e=e=>this._onStream(o,e);i=Rt.screenShareWebmBuilder&&Tt.isBrowserSupported()?new Tt(o,e):new bt(o,e),this._streamBuilders[o]=i}i.appendChunk(r)}close(e){let t=this._streamBuilders[e];t&&(t.destroy(),delete this._streamBuilders[e])}destroy(){this._datachannel.onbufferedamountlow=null,this._datachannel.onmessage=null,this._onStream=()=>{},Object.values(this._streamBuilders).forEach((e=>e.destroy())),this._streamBuilders={},this._participantIdRegistry=null,Gt.debug("ScreenCaptureReceiver destroyed")}static isBrowserSupported(){return(ke.isBrowserSupported()||Ae.isBrowserSupported())&&(bt.isBrowserSupported()||Tt.isBrowserSupported())}},Pt=class extends Pe{constructor(e,t){super(),this._video=null,this._imageCapture=null,this._canvas=null,this._canvasCtx=null,this._stream=null,this._track=null,this._frameReadTimeout=0,this._lastFrame=null,this._sourceTrack=e,this._onFrame=t,this._useImageCapture="ImageCapture"in window&&"ImageBitmap"in window,("live"!==e.readyState||!e.enabled||e.muted)&&(this._useImageCapture=!1)}_createDom(){this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden",this._canvas.style.position="absolute",this._canvas.style.width="160px",this._canvas.style.height="90px",this._canvas.style.bottom="0",this._canvas.style.right="160px",this._canvas.style.zIndex="5000",this._canvasCtx=this._canvas.getContext("2d"),document.body.appendChild(this._canvas)),!this._video&&!this._useImageCapture&&(this._video=document.createElement("video"),this._video.controls=!1,this._video.autoplay=!1,this._video.preload="auto",this._video.muted=!0,this._video.style.pointerEvents="none",this._video.style.visibility="hidden",this._video.style.position="absolute",this._video.style.width="160px",this._video.style.height="90px",this._video.style.bottom="0",this._video.style.right="0",this._video.style.zIndex="5000",document.body.appendChild(this._video))}_removeDom(){try{this._canvas&&document.body.removeChild(this._canvas),this._video&&document.body.removeChild(this._video)}catch(e){}this._canvasCtx=null,this._canvas=null,this._video=null}_createStream(e){return v(this,null,(function*(){if(!this._canvas)throw new Error("Canvas not found");if(!this._video&&!this._useImageCapture)throw new Error("Video element not found");return this._stream=this._canvas.captureStream(0),this._track=this._stream.getVideoTracks()[0],new Promise(((t,n)=>{if(this._useImageCapture)this._imageCapture=new ImageCapture(e),t();else{let r=this._video;r.srcObject=new MediaStream([e]),r.onloadeddata=e=>t(),r.onerror=()=>n(new Error("Video element error"));let o=r.play(),i=()=>n(new Error("Autoplay is disabled"));o?o.catch(i):i()}}))}))}_removeStream(){var e;window.clearTimeout(this._frameReadTimeout),null==(e=this._lastFrame)||e.close(),this._stream&&(this._stream.getTracks().forEach((e=>e.stop())),this._stream=null,this._track=null),this._video&&(this._video.pause(),this._video.srcObject=null),this._imageCapture&&(this._imageCapture=null)}_drawFrameVideo(){if(!(this._canvas&&this._canvasCtx&&this._video&&this._track))throw new Error("Fatal error");let e=this._video.videoWidth,t=this._video.videoHeight;return this._canvas.width=this._video.width=e,this._canvas.height=this._video.height=t,this._canvasCtx.clearRect(0,0,e,t),this._canvasCtx.drawImage(this._video,0,0,e,t),this._requestCanvasFrame(),this._canvasCtx.getImageData(0,0,e,t)}_getFrameBitmap(){return v(this,null,(function*(){if(!this._imageCapture)throw new Error("Destroyed");return this._imageCapture.grabFrame()}))}_drawFrameData(e){var t;if(!this._canvas||!this._canvasCtx||!this._track)throw new Error("Destroyed");let n=e.width,r=e.height;return this._canvas.width=n,this._canvas.height=r,this._canvasCtx.clearRect(0,0,n,r),this._canvasCtx.drawImage(e,0,0,n,r),this._requestCanvasFrame(),null==(t=this._canvasCtx)?void 0:t.getImageData(0,0,n,r)}_requestCanvasFrame(){this._track&&this._track.requestFrame?this._track.requestFrame():this._stream&&this._stream.requestFrame&&this._stream.requestFrame()}init(){return v(this,null,(function*(){this._createDom();let e=this._sourceTrack.getSettings().width,t=this._sourceTrack.getSettings().height;Gt.debug(`LibVPxEncoder started ${e}x${t}, codec ${this.isVP9()?"VP9":"VP8"}`),yield this._createStream(this._sourceTrack),yield this._createWorker('var exports=(()=>{var u=Object.defineProperty;var b=o=>u(o,"__esModule",{value:!0});var g=(o,n)=>{b(o);for(var t in n)u(o,t,{get:n[t],enumerable:!0})};var y={};g(y,{default:()=>R});var e=(r=>(r.INIT="init",r.READY="ready",r.FRAME="frame",r.ERROR="error",r.DEBUG="debug",r.LOG_ERROR="log_error",r))(e||{});var R=(o,n)=>{let t;function m(a,r){return o({locateFile:n}).then(s=>{if(t=new s.VpxEncoder,t.debug(r),!t.init(a?s.VpxType.VP9:s.VpxType.VP8))throw self.postMessage({type:e.LOG_ERROR,message:"encoder-init-fail-libvpx"}),new Error("LibVPxEncoder failed to create");t.setMaxQuantizer(10),t.setTargetBitrate(1024)})}function E(a,r,s,i){let c=t.allocateImage(a,r);if(!c){self.postMessage({type:e.FRAME,error:"No buffer data"});return}c.set(new Uint8Array(s));let f=Math.round(performance.now()),l=150;if(!t.encode(f,l,i)){self.postMessage({type:e.FRAME,error:"Encode failed"});return}let p=t.readFrame();if(!p){self.postMessage({type:e.FRAME,error:"No encoded data"});return}t.readFrame()&&(self.postMessage({type:e.DEBUG,message:"LibVPxEncoder dropped frame"}),self.postMessage({type:e.LOG_ERROR,message:"LibVPxEncoder-drop"}));let d=new Uint8Array(p.byteLength);d.set(p),self.postMessage({type:e.FRAME,frameType:i?"key":"delta",timestamp:f,duration:l,data:d.buffer},[d.buffer])}self.onmessage=a=>{switch(a.data.type){case e.INIT:m(a.data.isVP9,a.data.debug).then(()=>self.postMessage({type:e.READY})).catch(r=>self.postMessage({type:e.ERROR,error:String(r)}));break;case e.FRAME:E(a.data.width,a.data.height,a.data.imageData,a.data.keyFrame);break}}};return y;})();\n',(e=>{var t;e.error?this._onFrame(null,e.error):this._onFrame({type:e.frameType,timestamp:e.timestamp,duration:e.duration,data:e.data,byteLength:null==(t=e.data)?void 0:t.byteLength})}),[a(),a().getUrl],{isVP9:this.isVP9(),debug:Gt.enabled()})}))}_encode(e,t){let n=e.data.buffer;this._sendToWorker(Te.FRAME,{width:e.width,height:e.height,imageData:n,keyFrame:t},[n])}_requestFrameVideo(e){let t=this._drawFrameVideo();this._encode(t,e)}_requestFrameBitmap(e){this._frameReadTimeout=window.setTimeout((()=>{if(this._lastFrame){let t=this._drawFrameData(this._lastFrame);this._encode(t,e)}else this._onFrame(null)}),1e3),this._getFrameBitmap().then((t=>{var n;window.clearTimeout(this._frameReadTimeout),null==(n=this._lastFrame)||n.close(),this._lastFrame=t;let r=this._drawFrameData(t);this._encode(r,e)})).catch((()=>{}))}requestFrame(e=!1){this._useImageCapture?this._requestFrameBitmap(e):this._requestFrameVideo(e)}isVP9(){return!1}destroy(){this._removeWorker(),this._removeStream(),this._removeDom(),Gt.debug("LibVPxEncoder destroyed")}static isBrowserSupported(){return"WebAssembly"in window&&"Worker"in window&&("CanvasCaptureMediaStream"in window||"CanvasCaptureMediaStreamTrack"in window)}},At=class extends Pe{constructor(e,t){super(),this._sourceTrack=e,this._onFrame=t,this._trackProcessor=new MediaStreamTrackProcessor(e)}init(){return v(this,null,(function*(){let e=this._sourceTrack.getSettings().width,t=this._sourceTrack.getSettings().height,n=this._trackProcessor.readable;Gt.debug(`WebCodecsEncoder started ${e}x${t}, codec ${this.isVP9()?"VP9":"VP8"}`),yield this._createWorker('var exports=(()=>{var b=Object.defineProperty;var g=i=>b(i,"__esModule",{value:!0});var F=(i,n)=>{g(i);for(var r in n)b(i,r,{get:n[r],enumerable:!0})};var A={};F(A,{default:()=>h});var l=(r=>(r.VP9="vp09.00.50.08",r.VP8="vp8",r))(l||{}),d=(t=>(t.INIT="init",t.READY="ready",t.FRAME="frame",t.ERROR="error",t.DEBUG="debug",t.LOG_ERROR="log_error",t))(d||{});var h=()=>{let i=1e3,n,r,c,s,f,t,a=null,p=0,u=!1;function V(e){n=e.readable,r=n.getReader(),c=e.width,s=e.height,f=e.isVP9,t=e.framerate,m.configure({framerate:t,codec:f?l.VP9:l.VP8,width:c,height:s,latencyMode:"realtime"}),self.postMessage({type:d.READY})}function y(e){p=self.setTimeout(()=>{a&&E(a,e)},i),!u&&(u=!0,r.read().finally(()=>{u=!1,self.clearTimeout(p)}).then(({done:o,value:R})=>{if(a==null||a.close(),a=null,!(o||!R)){if(!m){r.releaseLock(),n.cancel();return}a=R,E(R,e)}}))}function E(e,o){(e.codedWidth!==c||e.codedHeight!==s)&&(c=e.codedWidth,s=e.codedHeight,m.configure({framerate:t,codec:f?l.VP9:l.VP8,width:c,height:s,latencyMode:"realtime"})),m.encode(e,{keyFrame:o})}let m=new VideoEncoder({output:e=>{let o;e.data?o=e.data:(o=new ArrayBuffer(e.byteLength),e.copyTo(o)),self.postMessage({type:d.FRAME,frameType:e.type,timestamp:e.timestamp,duration:e.duration,data:o},[o])},error:e=>{self.postMessage({type:d.FRAME,error:String(e)})}});self.onmessage=e=>{switch(e.data.type){case d.INIT:V(e.data);break;case d.FRAME:y(e.data.keyFrame);break}}};return A;})();\n',(e=>{var t;e.error?this._onFrame(null,e.error):this._onFrame({type:e.frameType,timestamp:e.timestamp,duration:e.duration,data:e.data,byteLength:null==(t=e.data)?void 0:t.byteLength})}),[],{readable:n,width:e,height:t,isVP9:this.isVP9(),framerate:Rt.screenFrameRate},[n])}))}requestFrame(e=!1){this._sendToWorker(Te.FRAME,{keyFrame:e})}isVP9(){return!0}destroy(){this._removeWorker(),Gt.debug("WebCodecsEncoder destroyed")}static isBrowserSupported(){return"VideoEncoder"in window&&"Worker"in window&&"EncodedVideoChunk"in window&&"MediaStreamTrackProcessor"in window}},kt=0,It=class{constructor(e,t){this._destroyed=!1,this._needKeyframe=!0,Gt.debug("ScreenCaptureSender started"),this._datachannel=t;let n=(e,t)=>{if(!this._destroyed){if(!e)return Gt.warn("requestFrame failed, keyFrame: "+this._needKeyframe,t),this._needKeyframe=!0,void this._requestFrame();this._send(e).catch((e=>{Gt.warn("sendFrame failed",e),this._needKeyframe=!0})).finally((()=>this._requestFrame()))}};At.isBrowserSupported()?this._encoder=new At(e,n):this._encoder=new Pt(e,n),this._datachannel.onmessage=e=>{(function(e){if(!e||!e.byteLength||4!==e.byteLength)return!1;let t=new DataView(e);return!(1!==t.getUint8(0)||1!==t.getUint8(1)||0!==t.getUint16(2))})(e.data)&&(Gt.debug(`[${this._datachannel.label}] Requested keyframe`),this._needKeyframe=!0)},this._encoder.init().then((()=>this._requestFrame())).catch((e=>Gt.warn("ScreenCaptureSender init failed",e)))}_requestFrame(){this._destroyed||(this._encoder.requestFrame(this._needKeyframe),this._needKeyframe=!1)}_wrapHeader(e,t,n,r,o){let i=function(e,t,n,r,o,i,a){let s=0;t&&(s|=1),n&&(s|=2),r&&(s|=4),a||(s|=8);let c=new ArrayBuffer(11),l=new DataView(c);if(l.setUint8(0,1),l.setUint16(1,o),l.setUint32(3,e),l.setUint8(7,i?1:0),l.setUint16(8,0),l.setUint8(10,s),!a)return c;let u=new Uint8Array(c.byteLength+a.byteLength);return u.set(new Uint8Array(c),0),u.set(new Uint8Array(a),c.byteLength),u.buffer}(e,t,n,r,kt,this._encoder.isVP9(),o);return kt=(kt+1)%65536,i}_stopPacket(){return this._wrapHeader(Date.now(),!1,!1,!1,null)}_send(e){return v(this,null,(function*(){return new Promise(((t,n)=>{this._sendChunk(e,0,t,n)}))}))}_sendChunk(e,t,n,r){if(!this._datachannel||"open"!==this._datachannel.readyState)return void r();let o=e.data.slice(t,t+16373),i=e.data.byteLength<=t+o.byteLength,a=this._wrapHeader(e.timestamp,!t,i,"key"===e.type,o);this._datachannel.onbufferedamountlow=i?()=>{this._datachannel.bufferedAmount<=this._datachannel.bufferedAmountLowThreshold&&n()}:null;try{this._datachannel.send(a)}catch(e){return Gt.warn("Error send data to DataChannel",e),void r()}i||window.setTimeout((()=>this._sendChunk(e,t+16373,n,r)),0)}destroy(){this._datachannel.onbufferedamountlow=null,this._datachannel.onmessage=null,"open"===this._datachannel.readyState&&this._datachannel.send(this._stopPacket()),this._destroyed=!0,this._encoder.destroy(),Gt.debug("ScreenCaptureSender destroyed")}static isBrowserSupported(){return At.isBrowserSupported()||Pt.isBrowserSupported()}},Ot=class{static get sessionKey(){return Ot._sessionKey}static set sessionKey(e){Ot._sessionKey=e}static get sessionSecretKey(){return Ot._sessionSecretKey}static set sessionSecretKey(e){Ot._sessionSecretKey=e}static get accessToken(){return Ot._accessToken}static set accessToken(e){Ot._accessToken=e}static isEmpty(){return!Ot._sessionKey||!Ot._sessionSecretKey}},xt=class{static set(e){e.hasOwnProperty("voiceParams")&&(Object.assign(xt._params.voiceParams,e.voiceParams),delete e.voiceParams),e.hasOwnProperty("specListenerParams")&&(Object.assign(xt._params.specListenerParams,e.specListenerParams),delete e.specListenerParams),e.hasOwnProperty("unifiedPlanBrowsers")&&(Object.assign(xt._params.unifiedPlanBrowsers,e.unifiedPlanBrowsers),delete e.unifiedPlanBrowsers),e.hasOwnProperty("apiAuth")&&(Ot.accessToken=e.apiAuth.accessToken,Ot.sessionKey=e.apiAuth.sessionKey,Ot.sessionSecretKey=e.apiAuth.sessionSecretKey),Object.assign(xt._params,e)}static get(e){return xt._params[e]}static get appName(){return"ok.calls.sdk.js"}static get appVersion(){return 1.1}static get sdkVersion(){return"2.5.2-beta.9"}static get debug(){}static get protocolVersion(){return xt._params.joinFromMultipleDevices?6:5}static get platform(){return xt._params.platform}static set platform(e){xt._params.platform=e}static get clientType(){return xt._params.clientType}static set clientType(e){xt._params.clientType=e}static get device(){return xt._params.device}static get apiKey(){return xt._params.apiKey}static get apiEnv(){return xt._params.apiEnv}static get apiEndpoint(){switch(xt.apiEnv){case"AUTO":case"PROD":return"https://api.mycdn.me";case"PROD_OK":return"https://api.ok.ru";case"TEST":return"https://apitest.ok.ru/api";case"VIDEOTEST":return"https://videotestapi.ok.ru/api";default:return xt._params.apiEnv}}static get authToken(){return xt._params.authToken}static set authToken(e){xt._params.authToken=e}static get anonymToken(){return xt._params.anonymToken}static set anonymToken(e){xt._params.anonymToken=e}static get domain(){return xt._params.domain}static get iceServers(){return xt._params.iceServers}static set iceServers(e){xt._params.iceServers=e}static get wssBase(){return xt._params.wssBase}static set wssBase(e){xt._params.wssBase=e}static get wssToken(){return xt._params.wssToken}static set wssToken(e){xt._params.wssToken=e}static get signalingReconnectDelay(){return xt._params.signalingReconnectDelay}static get signalingReconnectMaxDelay(){return xt._params.signalingReconnectMaxDelay}static get signalingReconnectMaxCount(){return xt._params.signalingReconnectMaxCount}static get waitConnectionDelay(){return xt._params.waitConnectionDelay}static get waitResponseDelay(){return xt._params.waitResponseDelay}static get waitMessageDelay(){return xt._params.waitMessageDelay}static get debugLog(){return xt._params.debugLog}static get forceRelayPolicy(){return xt._params.forceRelayPolicy}static set forceRelayPolicy(e){xt._params.forceRelayPolicy=e}static get videoMinWidth(){return xt._params.videoMinWidth}static get videoMaxWidth(){return xt._params.videoMaxWidth}static set videoMaxWidth(e){xt._params.videoMaxWidth=e}static get videoMinHeight(){return xt._params.videoMinHeight}static get videoMaxHeight(){return xt._params.videoMaxHeight}static set videoMaxHeight(e){xt._params.videoMaxHeight=e}static get videoAspectRatio(){return xt._params.videoAspectRatio}static get videoFrameRate(){return xt._params.videoFrameRate}static get videoFacingMode(){return xt._params.videoFacingMode}static get screenFrameRate(){return xt._params.screenFrameRate}static get videoEffects(){return xt._params.videoEffects}static set videoEffects(e){xt._params.videoEffects=e}static get videoEffectMaxWidth(){return xt._params.videoEffectMaxWidth}static set videoEffectMaxWidth(e){xt._params.videoEffectMaxWidth=e}static get videoEffectMaxHeight(){return xt._params.videoEffectMaxHeight}static set videoEffectMaxHeight(e){xt._params.videoEffectMaxHeight=e}static get voiceParams(){return xt._params.voiceParams}static get specListenerParams(){return xt._params.specListenerParams}static get iceRestartWaitTime(){return xt._params.iceRestartWaitTime}static get transportConnectionWaitTime(){return xt._params.transportConnectionWaitTime}static get statisticsInterval(){return xt._params.statisticsInterval}static set statisticsInterval(e){xt._params.statisticsInterval=e}static get networkStatisticsInterval(){return xt._params.networkStatisticsInterval}static get perfStatReportEnabled(){return xt._params.perfStatReportEnabled}static get callStatReportEnabled(){return xt._params.callStatReportEnabled}static get producerNotificationDataChannel(){return xt._params.producerNotificationDataChannel&&Dt.isBrowserSupported()}static get producerCommandDataChannel(){return xt._params.producerCommandDataChannel}static get consumerScreenDataChannel(){return xt._params.consumerScreenDataChannel&&It.isBrowserSupported()}static get producerScreenDataChannel(){return xt._params.producerScreenDataChannel&&xt.producerNotificationDataChannel}static get screenShareWebmBuilder(){return xt._params.screenShareWebmBuilder}static get noiseSuppression(){return xt._params.noiseSuppression}static set noiseSuppression(e){xt._params.noiseSuppression=e}static get preferH264(){return xt._params.preferH264}static get preferVP9(){return xt._params.preferVP9}static get audioNack(){return xt._params.audioNack}static get consumerScreenTrack(){return xt._params.consumerScreenTrack&&xt.consumerScreenDataChannel}static get producerScreenTrack(){return xt._params.producerScreenTrack&&xt.producerScreenDataChannel}static isUnifiedPlanSupported(e,t){let n=xt._params.unifiedPlanBrowsers;return!!n.hasOwnProperty(e)&&t>=n[e]}static get movieShare(){return xt._params.movieShare&&xt.videoTracksCount>0}static get videoTracksCount(){return xt.producerNotificationDataChannel?xt._params.videoTracksCount:0}static get breakVideoPayloadTypes(){return xt._params.breakVideoPayloadTypes}static get filteredMessages(){return xt._params.filteredMessages}static get batchParticipantsOnStart(){return xt._params.batchParticipantsOnStart}static get participantStateMapped(){return xt._params.participantStateMapped}},Rt=xt;Rt._params={platform:"WEB",clientType:"PORTAL",device:"browser",apiKey:"",authToken:"",anonymToken:"",apiEnv:"AUTO",domain:"",iceServers:[],wssBase:"",wssToken:"",signalingReconnectDelay:1e3,signalingReconnectMaxDelay:5e3,signalingReconnectMaxCount:20,waitConnectionDelay:1e4,waitResponseDelay:1e4,waitMessageDelay:15e3,debugLog:!1,forceRelayPolicy:!1,videoMinWidth:428,videoMinHeight:240,videoMaxWidth:1280,videoMaxHeight:720,videoAspectRatio:16/9,videoFrameRate:25,screenFrameRate:15,videoEffects:null,videoEffectMaxWidth:640,videoEffectMaxHeight:360,iceRestartWaitTime:2e4,transportConnectionWaitTime:5e3,statisticsInterval:5e3,networkStatisticsInterval:2e4,perfStatReportEnabled:!0,callStatReportEnabled:!1,voiceParams:{smoothing:.8,minFreq:200,maxFreq:5e3,interval:500,threshold:.35,speakerLevelMultiplier:1.8},specListenerParams:{connectionTimeout:1e4,volumeTimeout:1e4},unifiedPlanBrowsers:{Firefox:10,Chrome:76,Safari:12},producerNotificationDataChannel:!0,producerCommandDataChannel:!0,consumerScreenDataChannel:!0,producerScreenDataChannel:!0,screenShareWebmBuilder:!1,noiseSuppression:!0,preferH264:!1,preferVP9:!0,audioNack:!0,consumerScreenTrack:!1,producerScreenTrack:!1,videoTracksCount:0,movieShare:!1,filteredMessages:!1,breakVideoPayloadTypes:!1,batchParticipantsOnStart:!1,participantStateMapped:!1,joinFromMultipleDevices:!0};var Mt,Lt,Nt=((Mt=Nt||{}).WAITING_HALL="WAITING_HALL",Mt.WAITING="WAITING",Mt.CONNECTING="CONNECTING",Mt.CONNECTED="CONNECTED",Mt.RECONNECT="RECONNECT",Mt.ERROR="ERROR",Mt.HANGUP="HANGUP",Mt.PERMISSIONS="PERMISSIONS",Mt);function Bt(e,...t){let n=Rt.get(e);n&&setTimeout(n,0,...t)}function Ut(e){return Object.assign({},e)}function Ft(e){return e.slice()}(e=>{e.onLocalStream=function(e,t){Bt("onLocalStream",e,Ut(t))},e.onScreenStream=function(e,t){Bt("onScreenStream",e,Ut(t))},e.onLocalStreamUpdate=function(e,t){Bt("onLocalStreamUpdate",Ut(e),t)},e.onLocalStatus=function(e){Bt("onLocalStatus",e)},e.onRemoteStream=function(e,t){Bt("onRemoteStream",e,t)},e.onRemoteLive=function(e,t,n){Bt("onRemoteLive",e,t,n)},e.onRemoteScreenStream=function(e,t){Bt("onRemoteScreenStream",e,t)},e.onConversation=function(e,t,n,r){Bt("onConversation",e,Ut(t),Ut(n),r)},e.onRemoteMediaSettings=function(e,t){Bt("onRemoteMediaSettings",e,Ut(t))},e.onRemoteParticipantState=function(e,t){Bt("onRemoteParticipantState",e,Ut(t))},e.onRemoteStatus=function(e,t,n=null){Bt("onRemoteStatus",e,t,n)},e.onParticipantStatus=function(e,t,n=null){Bt("onParticipantStatus",e,t,n)},e.onPermissionsRequested=function(){Bt("onPermissionsRequested")},e.onPermissionsError=function(e){Bt("onPermissionsError",e)},e.onRemoteRemoved=function(e){Bt("onRemoteRemoved",e)},e.onCallState=function(e,t,n){Bt("onCallState",e,t,Ut(n))},e.onDeviceSwitched=function(e,t){Bt("onDeviceSwitched",e,t)},e.onMuteStates=function(e,t,n,r=!1,o=!1,i=null,a=null){Bt("onMuteStates",Ut(e),Ft(t),Ft(n),r,o,i,a)},e.onRolesChanged=function(e,t){Bt("onRolesChanged",e,Ft(t))},e.onLocalRolesChanged=function(e){Bt("onLocalRolesChanged",Ft(e))},e.onPinnedParticipant=function(e,t){Bt("onPinnedParticipant",e,t)},e.onLocalPin=function(e){Bt("onLocalPin",e)},e.onOptionsChanged=function(e){Bt("onOptionsChanged",Ft(e))},e.onCallAccepted=function(){Bt("onCallAccepted")},e.onRateNeeded=function(){Bt("onRateNeeded")},e.onSpeakerChanged=function(e){Bt("onSpeakerChanged",e)},e.onVolumesDetected=function(e){Bt("onVolumesDetected",Ft(e))},e.onLocalVolume=function(e,t){Bt("onLocalVolume",e,t)},e.onJoinStatus=function(e,t){Bt("onJoinStatus",e,t)},e.onHangup=function(e,t){Bt("onHangup",e,t)},e.onMultipartyChatCreated=function(e){Bt("onMultipartyChatCreated",Ut(e))},e.onDeviceChange=function(){Bt("onDeviceChange")},e.onFingerprintChange=function(e){Bt("onFingerprintChange",e)},e.onTokenExpired=function(){Bt("onTokenExpired")},e.onChatMessage=function(e,t,n=!1){Bt("onChatMessage",e,t,n)},e.onCustomData=function(e,t,n=!1){Bt("onCustomData",e,t,n)},e.onRecordStarted=function(e,t,n,r,o,i){Bt("onRecordStarted",e,t,n,r,o,i)},e.onRecordStopped=function(){Bt("onRecordStopped")},e.onLocalNetworkStatusChanged=function(e){Bt("onLocalNetworkStatusChanged",e)},e.onNetworkStatusChanged=function(e){Bt("onNetworkStatusChanged",e)},e.onDebugMessage=function(e,...t){Bt("onDebugMessage",e,...t)},e.onStatistics=function(e,t){Bt("onStatistics",Object.assign({},e,{memory:t}))},e.onAutoplayError=function(){Bt("onAutoplayError")},e.onChatRoomUpdated=function(e,t,n){Bt("onChatRoomUpdated",e,t,n)}})(Lt||(Lt={}));var Wt,jt=Lt,Vt=(e=>(e.DEBUG="DEBUG",e.LOG="LOG",e.WARN="WARN",e.ERROR="ERROR",e))(Vt||{});(e=>{let t="📞",n=(e,...t)=>{jt.onDebugMessage(e,...t)},r=!1,o=(e,t)=>(...n)=>{e(...n),function(e,t){!ye.available||(Ee.push({t:Date.now(),l:e,d:t}),be||(be=window.setTimeout((()=>{be=null,me()}),3e4)))}(t,n)},i=console.debug.bind(console,t),a=console.log.bind(console,t),s=console.warn.bind(console,t),c=console.error.bind(console,t),l=n.bind(null,"DEBUG"),u=n.bind(null,"LOG"),d=n.bind(null,"WARN"),_=n.bind(null,"ERROR");e.debug=l,e.log=u,e.warn=d,e.error=_,e.enabled=function(){return r},e.toggle=function(t){r=t,Rt.debugLog&&ve(),t?(e.debug=Rt.debugLog?o(i,"DEBUG"):i,e.log=Rt.debugLog?o(a,"LOG"):a,e.warn=Rt.debugLog?o(s,"WARN"):s,e.error=Rt.debugLog?o(c,"ERROR"):c):(e.debug=Rt.debugLog?o(l,"DEBUG"):l,e.log=Rt.debugLog?o(u,"LOG"):u,e.warn=Rt.debugLog?o(d,"WARN"):d,e.error=Rt.debugLog?o(_,"ERROR"):_)},e.send=function(t,...n){switch(t){case"DEBUG":e.debug(...n);break;case"LOG":e.log(...n);break;case"WARN":e.warn(...n);break;case"ERROR":e.error(...n)}}})(Wt||(Wt={}));var Ht,Kt,Gt=Wt,zt=(e=>(e.USER="USER",e.ANONYM="ANONYM",e.GROUP="GROUP",e))(zt||{});(e=>{function t(e,t="USER"){return{id:e,type:t}}function n(e){return`{"id":"${e.id}","type":"${e.type}"}`}e.fromIds=function(e){return e.length?"object"==typeof e[0]?e:e.map((e=>t(e))):[]},e.fromId=t,e.fromSignaling=function(e){return{id:e.id,type:"ANONYM"===e.type?"ANONYM":"USER"}},e.toString=n,e.fromIdToString=function(e,r="USER"){return n(t(e,r))},e.fromString=function(e){try{return JSON.parse(e)}catch(t){throw new Error(`Failed to parse ExternalId from string '${e}'`)}},e.compare=function(e,t){return e.id===t.id&&e.type===t.type}})(Ht||(Ht={})),(e=>{e.fromId=function(e,t="USER",n=0){return{id:e,type:t,deviceIdx:n}},e.toString=function(e){return`{"id":"${e.id}","type":"${e.type}","deviceIdx":"${e.deviceIdx}"}`},e.fromSignaling=function(e,t){return Object.assign({deviceIdx:t},Ht.fromSignaling(e))},e.getDeviceIdx=function(e){return e&&"object"==typeof e?e.deviceIdx:0}})(Kt||(Kt={}));var qt=(e=>(e.CAMERA="CAMERA",e.SCREEN="SCREEN",e.STREAM="STREAM",e.MOVIE="MOVIE",e))(qt||{});function $t(e){return e.participantId+(e.mediaType?":s"+e.mediaType:"")+(e.streamName?":m"+e.streamName:"")}function Yt(e){let t=e.split(Ve),n=t.shift();if(!n)throw new Error("Illegal stream description: "+e);let r,o=null,i=0;for(let n of t)switch(n.charAt(0)){case"s":o=Qt(n.slice(1));break;case"m":r=n.slice(1);break;case"d":i=Number.parseInt(n.slice(1),10);break;default:throw new Error("Unexpected parameter type "+n.charAt(0)+" in stream description "+e)}return{participantId:qe.compose(n,i),mediaType:o,streamName:r}}function Qt(e){for(let t of Object.keys(qt))if(t===e)return qt[t];return null}function Xt(e,t){return null===e||null===t?null===e&&null===t:!(e.maxDimension!==t.maxDimension||e.maxBitrateK!==t.maxBitrateK||e.maxFramerate!==t.maxFramerate||e.degradationPreference!==t.degradationPreference)}function Jt(e,t){return!(!Xt(e.camera,t.camera)||!Xt(e.screenSharing,t.screenSharing))}function Zt(e,t){return{camera:Object.assign({},e.camera,t.camera),screenSharing:Object.assign({},e.screenSharing,t.screenSharing)}}var en=class{constructor(e){this._fixNoPacketsApplied=!1,this._fixNoPacketsChecked=!1,this._fixTooManyPacketsApplied=!1,this._fixTooManyPacketsSucceeded=!1,this._fixTooManyPacketsFailed=!1,this._mediaSource=e}_fixAudioDeviceNoPackets(e){if(!this._fixNoPacketsApplied||!this._fixNoPacketsChecked){if(this._fixNoPacketsApplied&&!this._fixNoPacketsChecked)return this._fixNoPacketsChecked=!0,void De.log(Z.ERROR,"audio_device_recover_"+(e.bandwidth?"success":"fail"));!this._fixNoPacketsApplied&&!e.bandwidth&&(this._fixNoPacketsApplied=!0,De.log(Z.ERROR,"audio_device_recover"),this._mediaSource.toggleAudio(!0))}}_fixAudioDeviceTooManyPackets(e){if(this._fixTooManyPacketsSucceeded||this._fixTooManyPacketsFailed)return;let t=Date.now();if(this._lastPacketsSentTime){if(t-this._lastPacketsSentTime>500){let n=1e3*(e.packetsSent-this._lastPacketsSent)/(t-this._lastPacketsSentTime);this._lastPacketsSentTime=t,this._lastPacketsSent=e.packetsSent,this._fixTooManyPacketsApplied?n>75?(Gt.log("Failed to fix RV"),De.log(Z.ERROR,"audio_device_recover_rv_fail"),this._fixTooManyPacketsFailed=!0):t-this._fixTooManyPacketsTime>6e4&&(Gt.log("Fixed RV"),De.log(Z.ERROR,"audio_device_recover_rv_success"),this._fixTooManyPacketsSucceeded=!0):n>75&&(this._fixTooManyPacketsApplied=!0,Gt.log("Trying to fix RV"),this._mediaSource.toggleAudio(!0),this._fixTooManyPacketsTime=t)}}else e.packetsSent>0&&(this._lastPacketsSentTime=t,this._lastPacketsSent=e.packetsSent)}fix(e){if(!this._mediaSource)return;let t=e.find((e=>e.kind===We.audio));!t||(this._fixAudioDeviceNoPackets(t),this._fixAudioDeviceTooManyPackets(t))}},tn=class extends y{constructor(){super(...arguments),this._lastMemoryStat={percent:0,bytes:0}}onRemoteDataStats(e,t){this._calcMemory(),e.inbound.rtps.map((e=>{let n="string"==typeof e.userId&&t[e.userId]||null;e.userId=null==n?void 0:n.externalId})),jt.onStatistics(e,this._lastMemoryStat)}_calcMemory(){var e;let t=null==(e=null==window?void 0:window.performance)?void 0:e.memory;if(!t||!t.usedJSHeapSize||!t.jsHeapSizeLimit)return;let n=Number((100*t.usedJSHeapSize/t.jsHeapSizeLimit).toFixed(2)),r=Number((t.usedJSHeapSize/1024/1024).toFixed(1));n>90?Gt.warn(`High memory usage: ${n}% (${r} MiB)`):(!this._lastMemoryStat.percent||Math.abs(n-this._lastMemoryStat.percent)>=3)&&(Gt.debug(`Memory usage: ${n}% (${r} MiB)`),this._lastMemoryStat.percent=n,this._lastMemoryStat.bytes=t.usedJSHeapSize)}},nn=class{constructor(e,t){this._analyser=null,this._gainNode=null,this._fftBins=null,this._mediaStreamSource=null,this._lastSmoothedLevel=0,this._trackId=e,this._stream=t;try{let e=Et.getAudioContext();this._gainNode=e.createGain(),this._gainNode.gain.value=1e-5,this._gainNode.connect(e.destination),this._analyser=e.createAnalyser(),this._analyser.fftSize=1024,this._analyser.smoothingTimeConstant=0,this._analyser.connect(this._gainNode),this._fftBins=new Uint8Array(this._analyser.frequencyBinCount),this._mediaStreamSource=e.createMediaStreamSource(t),this._mediaStreamSource.connect(this._analyser)}catch(e){}}get stream(){return this._stream}get trackId(){return this._trackId}_getBins(){if(!this._fftBins||!this._analyser)return new Uint8Array;this._analyser.getByteFrequencyData(this._fftBins);let e=44100/this._fftBins.length,t=Math.ceil(Rt.voiceParams.minFreq/e),n=Math.floor(Rt.voiceParams.maxFreq/e);return this._fftBins.subarray(t,n)}getLevel(){let e=this._getBins(),t=e.reduce(((e,t)=>e+t),0)/e.length/255,n=this._lastSmoothedLevel*Rt.voiceParams.smoothing+t*(1-Rt.voiceParams.smoothing);return this._lastSmoothedLevel=n,{real:t,smoothed:n}}destroy(){this._mediaStreamSource&&(this._mediaStreamSource.disconnect(),this._mediaStreamSource=null),this._gainNode&&(this._gainNode.disconnect(),this._gainNode=null),this._analyser&&(this._analyser.disconnect(),this._analyser=null,this._fftBins=null,this._lastSmoothedLevel=0)}},rn=class extends y{constructor(e){super(),this._detector=null,this._track=null,this._interval=null;let t=()=>{this._detector&&jt.onLocalVolume(this._detector.getLevel().real,e.getMediaSettings().isAudioEnabled),this._interval=window.setTimeout(t,Rt.voiceParams.interval)};this._interval=window.setTimeout(t,Rt.voiceParams.interval);let n=()=>{let t=e.getStream();t&&this.init(t)};this.subscribe(e,Fe.SOURCE_CHANGED,(e=>{e.kind===We.audio&&e.mediaSettings.isAudioEnabled&&n()})),n()}init(e){this._stopDetector();let t=e.getAudioTracks();t.length&&(this._track=t[0].clone(),this._detector=new nn("local",new MediaStream([this._track])))}_stopDetector(){this._detector&&(this._detector.destroy(),this._detector=null),this._track&&(this._track.stop(),this._track=null)}destroy(){this.unsubscribe(),this._interval&&(window.clearTimeout(this._interval),this._interval=null),this._stopDetector()}},on="videochat-epi",an=class extends y{constructor(e,t,n=!1){super(),this._previousTimestamp=0,this._previousCallStatReportTimestamp=0,this._previousCallStatReport={nack_sent:0,nack_received:0,pli_sent:0,pli_received:0,fir_sent:0,fir_received:0,frames_dropped:0,jitter_video:0,jitter_audio:0,interframe_delay_variance:0,total_audio_samples_received:0,concealed_audio_samples:0,inserted_audio_samples_for_deceleration:0,removed_audio_samples_for_acceleration:0,silent_concealed_audio_samples:0,audio_concealment_events:0,total_audio_energy:0},this._signaling=t,this._directTopology=n,this.subscribe(e,Dn.REMOTE_DATA_STATS,this._handleStats.bind(this))}destroy(){this.unsubscribe()}static getEstimatedPerformanceIndex(){try{let e=parseInt(localStorage.getItem(on)||"",10);return isNaN(e)?0:e}catch(e){return 0}}_handleStats(e){return v(this,null,(function*(){if(!e.inbound||!e.inbound.rtps)return;let t=Date.now();!this._directTopology&&Rt.perfStatReportEnabled&&this._previousTimestamp+5e3<=t&&(yield this.reportPerfStats(e),this._previousTimestamp=t),Rt.callStatReportEnabled&&this._previousCallStatReportTimestamp+3e4<=t&&(this._reportCallStats(e),this._previousCallStatReportTimestamp=t)}))}reportPerfStats(e){return v(this,null,(function*(){let t=e.inbound.rtps.reduce(((e,t)=>("video"===t.kind&&(e.framesDecoded+=t.framesDecoded||0,e.framesReceived+=t.framesReceived||0),e)),{framesDecoded:0,framesReceived:0});if(t.framesDecoded)try{let e=yield this._signaling.reportPerfStat(t);localStorage.setItem(on,e.estimatedPerformanceIndex)}catch(e){}}))}_reportCallStats(e){let t={nack_received:0,pli_received:0,fir_received:0,frames_dropped:0,jitter_video:0,jitter_audio:0,interframe_delay_variance:0,nack_sent:0,pli_sent:0,fir_sent:0,total_audio_samples_received:0,concealed_audio_samples:0,silent_concealed_audio_samples:0,inserted_audio_samples_for_deceleration:0,removed_audio_samples_for_acceleration:0,audio_concealment_events:0,total_audio_energy:0,inbound_video_count:0,inbound_audio_count:0};e.inbound.rtps.reduce(((e,t)=>("video"===t.kind?(t.framesReceived&&(e.jitter_video=e.jitter_video*e.inbound_video_count/(e.inbound_video_count+1)+1e3*t.jitter/(e.inbound_video_count+1),e.interframe_delay_variance=e.interframe_delay_variance*e.inbound_video_count/(e.inbound_video_count+1)+1e6*t.interframeDelayVariance/(e.inbound_video_count+1),e.inbound_video_count++),e.frames_dropped+=t.framesDropped,e.nack_sent+=t.nackCount,e.pli_sent+=t.pliCount,e.fir_sent+=t.firCount):(t.totalSamplesReceived&&(e.jitter_audio=e.jitter_audio*e.inbound_audio_count/(e.inbound_audio_count+1)+1e3*t.jitter/(e.inbound_audio_count+1),e.total_audio_energy=e.total_audio_energy*e.inbound_audio_count/(e.inbound_audio_count+1)+t.totalAudioEnergy/(e.inbound_audio_count+1),e.inbound_audio_count++),e.total_audio_samples_received+=t.totalSamplesReceived,e.inserted_audio_samples_for_deceleration+=t.insertedSamplesForDeceleration,e.removed_audio_samples_for_acceleration+=t.removedSamplesForAcceleration,e.concealed_audio_samples+=t.concealedSamples,e.silent_concealed_audio_samples+=t.silentConcealedSamples,e.audio_concealment_events+=t.concealmentEvents),e)),t),e.outbound.rtps.reduce(((e,t)=>("video"===t.kind&&(e.nack_received+=t.nackCount,e.pli_received+=t.pliCount,e.fir_received+=t.firCount),e)),t);let n={call_topology:this._directTopology?"D":"S",nack_sent:t.nack_sent-this._previousCallStatReport.nack_sent,nack_received:t.nack_received-this._previousCallStatReport.nack_received,pli_sent:t.pli_sent-this._previousCallStatReport.pli_sent,pli_received:t.pli_received-this._previousCallStatReport.pli_received,fir_sent:t.fir_sent-this._previousCallStatReport.fir_sent,fir_received:t.fir_received-this._previousCallStatReport.fir_received,frames_dropped:t.frames_dropped-this._previousCallStatReport.frames_dropped};if(t.jitter_video&&(n.jitter_video=t.jitter_video),t.jitter_audio&&(n.jitter_audio=t.jitter_audio),t.interframe_delay_variance&&(n.interframe_delay_variance=t.interframe_delay_variance),t.total_audio_samples_received){let e=t.total_audio_samples_received-this._previousCallStatReport.total_audio_samples_received,r=t.inserted_audio_samples_for_deceleration-this._previousCallStatReport.inserted_audio_samples_for_deceleration,o=t.removed_audio_samples_for_acceleration-this._previousCallStatReport.removed_audio_samples_for_acceleration,i=t.concealed_audio_samples-this._previousCallStatReport.concealed_audio_samples,a=t.silent_concealed_audio_samples-this._previousCallStatReport.silent_concealed_audio_samples,s=t.audio_concealment_events-this._previousCallStatReport.audio_concealment_events;n.inserted_audio_samples_for_deceleration=r/e*1e3,n.removed_audio_samples_for_acceleration=o/e*1e3,n.concealed_audio_samples=i/e*1e3,n.concealed_silent_audio_samples=a/e*1e3,n.concealment_audio_avg_size=i/s,n.total_audio_energy=t.total_audio_energy}De.logCustom("callStat",n),Gt.log("Sent call stats",n),this._previousCallStatReport=t}};function sn(e,t,n=0){return t in e&&e[t]?e[t]:n}function cn(...e){return t=>{for(let n of e)if(n(t))return!0;return!1}}function ln(e,t){return n=>n[e]===t}function un(e,t){return t.reduce(((t,n)=>(t[n[e]]=n,t)),{})}function dn(e){let t={},n=[];for(let r of e)t[r.id]||(t[r.id]=!0,n.push(r));return n}function _n(e){return Object.keys(e).filter((t=>void 0!==e[t])).map((t=>[t,e[t]])).reduce(((e,t)=>(e[t[0]]=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}(t[1])?_n(t[1]):t[1],e)),{})}function pn(e){let t=[];for(let n of e)n.forEach((e=>t.push(e)));return t}function hn(e){return v(this,null,(function*(){let t=[];return RTCRtpReceiver.prototype.getStats?(t.push(...e.getReceivers().map((e=>e.getStats()))),t.push(...e.getSenders().map((e=>e.getStats())))):t.push(e.getStats()),Promise.all(t).then(pn).then(dn)}))}function fn(e){let t=e.filter(ln("type","candidate-pair")).sort(function(e){return(t,n)=>t[e]-n[e]}("priority")).find(cn(ln("nominated",!0),ln("selected",!0)));if(!t)return{totalRoundTripTime:0,currentRoundTripTime:0,bytesSent:0,bytesReceived:0};let n={totalRoundTripTime:t.totalRoundTripTime||0,currentRoundTripTime:t.currentRoundTripTime||0,bytesSent:t.bytesSent,bytesReceived:t.bytesReceived},r=e.find(ln("id",t.remoteCandidateId));r&&(n=Object.assign({},n,{remote:{type:r.candidateType,address:r.ip||r.address,port:r.port,protocol:r.protocol}}));let o=e.find(ln("id",t.localCandidateId));return o&&(n=Object.assign({},n,{local:{type:o.candidateType,address:o.ip||o.address,port:o.port,protocol:o.protocol,relayProtocol:o.relayProtocol,networkType:o.networkType}})),_n(n)}function mn(e,t){let n=un("id",e),r=e.filter(cn(ln("type","inbound-rtp"),ln("type","outbound-rtp")));"Firefox"===Et.browserName()&&(r=Object.values(r.reduce(((e,t)=>{if(e[t.ssrc]){let n=Object.assign({},e[t.ssrc],t),r=e[t.ssrc].isRemote?t:e[t.ssrc];n.id=r.id,n.type=r.type,delete n.isRemote,delete n.remoteId,e[n.ssrc]=n}else e[t.ssrc]=t;return e}),{})));let o={};if("Safari"===Et.browserName()){let t=e.filter(ln("type","track"));o=un("trackIdentifier",t)}return r.map((e=>{let r=Number(e.ssrc),i=e.mediaType||e.kind,a=e.trackId,s=e.type,c=e.codecId;if("Safari"===Et.browserName()){let n=/^.+_([\d]+)$/.exec(e.id);if(n&&(r=parseInt(n[1],10)),i=e.id.indexOf("Audio")>0?"audio":"video",t[r]){let e=i+"-"+t[r];o[e]&&(a=o[e].id)}}if(!s||!r||!i)return null;let l={ssrc:r,type:s,kind:i,bytesReceived:sn(e,"bytesReceived"),bytesSent:sn(e,"bytesSent"),jitter:sn(e,"jitter"),packetsLost:sn(e,"packetsLost"),packetsReceived:sn(e,"packetsReceived"),packetsSent:sn(e,"packetsSent"),fractionLost:sn(e,"fractionLost"),pliCount:sn(e,"pliCount"),firCount:sn(e,"firCount"),nackCount:sn(e,"nackCount"),userId:t[r]};if("video"===i){let t=sn(e,"framesDecoded"),n=sn(e,"totalInterFrameDelay"),r=sn(e,"totalSquaredInterFrameDelay");l.interframeDelayVariance=(r-n*n/t)/t}if("audio"===i&&(l.totalSamplesReceived=sn(e,"totalSamplesReceived"),l.concealedSamples=sn(e,"concealedSamples"),l.insertedSamplesForDeceleration=sn(e,"insertedSamplesForDeceleration"),l.removedSamplesForAcceleration=sn(e,"removedSamplesForAcceleration"),l.silentConcealedSamples=sn(e,"silentConcealedSamples"),l.concealmentEvents=sn(e,"concealmentEvents"),l.totalAudioEnergy=sn(e,"totalAudioEnergy")),c&&n[c]){let e=n[c];l.clockRate=e.clockRate,l.mimeType=e.mimeType}if(a&&n[a]){let e=n[a];l.frameHeight=e.frameHeight,l.frameWidth=e.frameWidth,l.framesDecoded=e.framesDecoded,l.framesReceived=e.framesReceived,l.framesDropped=e.framesDropped}return _n(l)})).filter((e=>!!e))}function gn(e,t){if(!t||!t.rtps||!e.rtps)return e;let n=un("ssrc",e.rtps),r=un("ssrc",t.rtps),o=(e.timestamp-t.timestamp)/1e3;return!n||!r||Object.keys(n).forEach((e=>{let t=n[e],i=r[e];if(t&&i){if(t.bytesReceived&&t.bytesReceived>i.bytesReceived&&(t.bandwidth=Math.round((t.bytesReceived-i.bytesReceived)/o)),t.bytesSent&&t.bytesSent>i.bytesSent&&(t.bandwidth=Math.round((t.bytesSent-i.bytesSent)/o)),t.packetsReceived)if(t.packetsReceived>i.packetsReceived||t.packetsLost>i.packetsLost){let e=t.packetsLost-i.packetsLost,n=t.packetsReceived-i.packetsReceived;t.packetLoss=parseFloat((100*e/(e+n)).toFixed(2))}else t.packetLoss=0;t.framesDropped&&i.framesDropped&&t.framesDropped>i.framesDropped&&(t.framesDroppedDelta=parseFloat(((t.framesDropped-i.framesDropped)/o).toFixed(0)))}})),e}function vn(e,t){return v(this,arguments,(function*(e,t,n={}){let r=yield hn(e),o={timestamp:Date.now(),transport:fn(r),rtps:mn(r,n)};return t?gn(o,t):(yield qe.delay(1e3),vn(e,o,n))}))}var yn,En,wn=.8,bn=class extends y{constructor(e,t,n,r,o){if(super(),this._remoteSDP={},this._remoteCandidates={},this._state=Pn.IDLE,this._isOpen=!1,this._remotePeerId=null,this._statInterval=null,this._settingsInterval=null,this._failedOnCreate=null,this._remoteStream=null,this._iceRestartTimeout=null,this._reconnectionTimeout=null,this._reconnectionPrevented=!1,this._fingerprint=null,this._neverConnected=!0,this._prevConsumerSettings={},this._lastNetworkStat={rtt:0,loss:0,date:0},this._remoteNetworkStat={rtt:0,loss:0},this._networkLimits={badNet:{loss:3,rtt:1e3},goodNet:{loss:.5,rtt:600}},this._signaling=n,this._mediaSource=r,this._participantId=e,this._isMaster=t,this._serverSettings=o,this._perfStatReporter=new an(this,n,!0),this.subscribe(this._signaling,Y.NOTIFICATION,this._onSignalingNotification.bind(this)),this.subscribe(this._mediaSource,Fe.TRACK_REPLACED,this._onReplacedTrack.bind(this)),this.subscribe(this._mediaSource,Fe.SOURCE_CHANGED,this._applySettings.bind(this)),this._pc=new RTCPeerConnection({iceServers:Rt.iceServers,iceTransportPolicy:Rt.forceRelayPolicy?"relay":"all"},{optional:[{googSuspendBelowMinBitrate:!1}]}),this._pc.onicecandidate=this._handleIceCandidate.bind(this),this._pc.ontrack=this._onAddTrack.bind(this),this._pc.oniceconnectionstatechange=this._onIceConnectionStateChange.bind(this),this._pc.onconnectionstatechange=this._onConnectionStateChange.bind(this),this._pc.onsignalingstatechange=this._onSignalingStateChange.bind(this),this._prevConsumerSettings={},this._isMaster){try{this._mediaSource.addTrackToPeerConnection(this._pc,!1,!0),this._applySettings()}catch(e){return De.log(Z.ERROR,"addTrack-direct"),Gt.error("Unable to add media source tracks",e,{participantId:this._participantId}),void(this._failedOnCreate=e)}this._createOffer(!1).catch((e=>{this._state===Pn.IDLE?this._failedOnCreate=e:this.close(e)}))}this._startSettingsInterval(),this._startStatInterval()}getState(){return this._state}updateStatisticsInterval(){this._stopStatInterval();let e=this.getState();e!==Pn.IDLE&&e!==Pn.CLOSED&&e!==Pn.FAILED&&this._startStatInterval()}open(e=null){return v(this,null,(function*(){if(this._isOpen)return void Gt.warn("DirectTransport: Already opened",{participantId:this._participantId});if(this._failedOnCreate)return void this.close(this._failedOnCreate);if(Gt.debug("DirectTransport: Open transport",{participantId:this._participantId}),this._isOpen=!0,this._remotePeerId=e,!this._isMaster)try{this._mediaSource.addTrackToPeerConnection(this._pc,!1,!0),this._applySettings()}catch(e){return De.log(Z.ERROR,"addTrack-direct"),Gt.error("DirectTransport: Unable to add media source tracks",e,{participantId:this._participantId}),void this.close(e)}this._setState(Pn.OPENED);let t=e;if(!e){let e=Object.keys(this._remoteSDP);t=e[e.length-1]}if(t&&this._remoteSDP[t])try{yield this._setRemoteDescription(t,this._remoteSDP[t])}catch(e){return void this.close()}this._remoteSDP={},this._remoteCandidates={},this._triggerEvent(Dn.ACTIVE_PARTICIPANTS_NO_SIGNAL)}))}updateSettings(e){Jt(e,this._serverSettings)||(this._serverSettings=e,this._applySettings())}preventRestart(){this._reconnectionPrevented=!0}allowRestart(){this._reconnectionPrevented=!1}close(e){this._isOpen=!1,this._stopReconnection(),this._remoteStream&&(this._remoteStream.getTracks().forEach((e=>{e.stop(),this._triggerEvent(Dn.REMOTE_TRACK_REMOVED,this._remoteStream,e)})),this._remoteStream=null),this._stopStatInterval(),this._stopSettingsInterval(),this._pc&&(this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.oniceconnectionstatechange=null,this._pc.onconnectionstatechange=null,this._pc.onsignalingstatechange=null,this._pc.close()),this.unsubscribe(),e?(Gt.error("DirectTransport: Closed",e,{participantId:this._participantId}),this._setState(Pn.FAILED)):(Gt.debug("DirectTransport: Closed",{participantId:this._participantId}),this._setState(Pn.CLOSED)),this._triggerEvent(Dn.PEER_CONNECTION_CLOSED)}_setState(e){this._state!==e&&(Gt.debug(`DirectTransport: State changed to ${e}`,{participantId:this._participantId}),this._state=e,this._triggerEvent(Dn.STATE_CHANGED,e))}_onSignalingNotification(e){var t,n,r,o;switch(e.notification){case X.TRANSMITTED_DATA:this._handleTransmittedData(e);break;case X.SETTINGS_UPDATE:Object.assign(this._networkLimits.badNet,(null==(t=e.settings)?void 0:t.badNet)||{}),Object.assign(this._networkLimits.goodNet,(null==(n=e.settings)?void 0:n.goodNet)||{});break;case X.CUSTOM_DATA:e.data.hasOwnProperty("sdk")&&(this._remoteNetworkStat.rtt=(null==(r=e.data.sdk)?void 0:r.rtt)||0,this._remoteNetworkStat.loss=(null==(o=e.data.sdk)?void 0:o.loss)||0)}}_handleTransmittedData(e){let t=e.data,n=qe.getPeerIdString(e.peerId);qe.composeMessageId(e)===this._participantId&&(t.candidate&&t.candidate.candidate?this._addIceCandidate(n,t.candidate).catch(this.close.bind(this)):t.sdp&&this._setRemoteDescription(n,t.sdp).catch(this.close.bind(this)))}_addIceCandidate(e,t){return v(this,null,(function*(){if(this._isOpen&&(!this._remotePeerId||this._remotePeerId===e)&&this._pc&&this._pc.remoteDescription){Gt.debug("Add remote ice candidate",{participantId:this._participantId,candidate:t});try{yield this._pc.addIceCandidate(new RTCIceCandidate(t))}catch(e){throw De.log(Z.ERROR,"addIceCandidate-direct"),Gt.error("Unable to add remote ice candidate",e,{participantId:this._participantId,candidate:t}),e}}else Gt.debug("Cache remote ice candidate",{participantId:this._participantId,candidate:t}),this._remoteCandidates[e]=this._remoteCandidates[e]||[],this._remoteCandidates[e].push(t)}))}_setRemoteCandidates(e){return v(this,null,(function*(){if(!this._remoteCandidates[e])return void Gt.log(`No cached candidates found for peer ${e}`);let t=this._remoteCandidates[e];this._remoteCandidates[e]=[];for(let n of t)try{yield this._addIceCandidate(e,n)}catch(e){}}))}_setRemoteDescription(e,t){return v(this,null,(function*(){if(!this._isOpen||this._remotePeerId&&this._remotePeerId!==e||!this._pc)this._remoteSDP[e]=t;else{Gt.debug("Add remote description",{participantId:this._participantId,sdp:t}),this._calcFingerprint(t.sdp);try{yield this._pc.setRemoteDescription(new RTCSessionDescription(t)),yield this._setRemoteCandidates(e)}catch(e){throw De.log(Z.ERROR,"setRemoteDescription-direct"),Gt.error("Unable to set remote description",e,{participantId:this._participantId,sdp:t}),e}}}))}_onAddTrack(e){Gt.debug("Added remote track",{participantId:this._participantId,kind:e.track.kind}),this._remoteStream?this._remoteStream.addTrack(e.track):(this._remoteStream=new MediaStream([e.track]),this._remoteStream.onremovetrack=e=>{this._triggerEvent(Dn.REMOTE_TRACK_REMOVED,this._remoteStream,e.track)}),this._triggerEvent(Dn.REMOTE_TRACK_ADDED,this._remoteStream,e.track)}_handleIceCandidate(e){return v(this,null,(function*(){e.candidate&&this._signaling.ready&&(Gt.debug("Local ice candidate",{participantId:this._participantId,candidate:e.candidate}),yield this._signaling.sendCandidate(this._participantId,e.candidate))}))}_onSignalingStateChange(){switch(Gt.debug(`DirectTransport: Signaling state changed to ${this._pc.signalingState}`,{participantId:this._participantId}),this._pc.signalingState){case"have-local-offer":let e=this._pc.localDescription;e?this._signaling.sendSdp(this._participantId,e).catch(this.close.bind(this)):this.close(new Error);break;case"have-remote-offer":this._createAnswer().catch(this.close.bind(this)).then((e=>v(this,null,(function*(){return this._signaling.sendSdp(this._participantId,e)})))).catch(this.close.bind(this))}}_onIceConnectionStateChange(){if("checking"===(Gt.debug(`DirectTransport: Ice Connection state changed to ${this._pc.iceConnectionState}`,{participantId:this._participantId}),this._pc.iceConnectionState)){let e=this.getState();e===Pn.IDLE||e===Pn.OPENED?this._setState(Pn.CONNECTING):this._setState(Pn.RECONNECTING)}}_onConnectionStateChange(){switch(Gt.debug(`DirectTransport: Connection state changed to ${this._pc.connectionState}`,{participantId:this._participantId}),De.log(Z.ICE_CONNECTION_STATE,this._pc.connectionState),this._pc.connectionState){case"connected":this._neverConnected=!1,this._setState(Pn.CONNECTED),this._stopReconnection(),qe.getPeerConnectionHostInfo(this._pc).then((e=>{e&&De.log(Z.ICE_CONNECTION_TYPE,e.type)}));break;case"failed":case"disconnected":this._reconnectionPrevented?this.close(new Error(`Ice connection ${this._pc.connectionState}`)):(this._setState(Pn.RECONNECTING),this._startReconnection());break;case"closed":this.close(new Error("Ice connection closed"))}}_startReconnection(){this._reconnectionTimeout||this._iceRestartTimeout||(Gt.log("Waiting for reconnection...",{participantId:this._participantId}),this._reconnectionTimeout=window.setTimeout((()=>{this._reconnectionTimeout=null,this._neverConnected?this._requestTopologySwitch():this._startIceRestart()}),Rt.transportConnectionWaitTime))}_requestTopologySwitch(){this._isMaster&&this._signaling.ready&&(Gt.log("Switch topology DIRECT to SERVER",{participantId:this._participantId}),this._signaling.switchTopology(An.SERVER))}_stopReconnection(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=null),this._iceRestartTimeout&&(clearTimeout(this._iceRestartTimeout),this._iceRestartTimeout=null)}_startIceRestart(){this._isMaster?(De.log(Z.ICE_RESTART),Gt.log("Ice restart",{participantId:this._participantId}),this._createOffer(!0).catch(this.close.bind(this))):Gt.debug("Waiting for ice restart...",{participantId:this._participantId}),this._iceRestartTimeout=window.setTimeout((()=>{this._iceRestartTimeout=null,Gt.error("Ice restart failed",{participantId:this._participantId}),De.log(Z.ERROR,"iceRestart-direct"),this._requestTopologySwitch()}),Rt.iceRestartWaitTime)}_createOffer(e){return v(this,null,(function*(){let t={iceRestart:e,offerToReceiveAudio:!0,offerToReceiveVideo:!0};return Gt.debug("Create offer",{participantId:this._participantId,options:t}),this._pc.createOffer(t).catch((e=>{throw Gt.error("Unable to create offer",e,{participantId:this._participantId}),De.log(Z.ERROR,"createOffer-direct"),e})).then((e=>v(this,null,(function*(){return Gt.debug("Created offer",{participantId:this._participantId,offer:e}),e=bn._patchDescription(e),Gt.debug("Set local description",{participantId:this._participantId,offer:e}),this._calcFingerprint(e.sdp),this._pc.setLocalDescription(e).then((()=>this._pc.localDescription))})))).catch((e=>{throw Gt.error("Unable to set local description",e,{participantId:this._participantId}),De.log(Z.ERROR,"setLocalDescription-direct"),e}))}))}_createAnswer(){return v(this,null,(function*(){return Gt.debug("Create answer",{participantId:this._participantId}),this._pc.createAnswer().catch((e=>{throw Gt.error("Unable to create answer",e,{participantId:this._participantId}),De.log(Z.ERROR,"createAnswer-direct"),e})).then((e=>v(this,null,(function*(){return Gt.debug("Created answer",{participantId:this._participantId,answer:e}),e=bn._patchDescription(e),Gt.debug("Set local description",{participantId:this._participantId,answer:e}),this._calcFingerprint(e.sdp),this._pc.setLocalDescription(e)})))).then((()=>this._pc.localDescription)).catch((e=>{throw Gt.error("Unable to set local description",e,{participantId:this._participantId}),De.log(Z.ERROR,"setLocalDescription-direct"),e}))}))}static _patchDescription(e){let t=!!Et.baseChromeVersion();return e.sdp=qe.patchSDP(e.sdp,Rt.preferH264&&Et.canPreferH264(),Et.isBrokenH264(),Rt.preferVP9,t&&Rt.audioNack),e}_onReplacedTrack(e){this._pc&&(this._pc.getSenders().forEach((t=>{t.track&&t.track.kind===e.kind&&(t.track.enabled=e.enabled,t.replaceTrack(e).catch((e=>{Gt.error("DirectTransport: Unable to replace track",e,{participantId:this._participantId}),De.log(Z.ERROR,"replaceTrack-direct")})))})),this._applySettings())}_startStatInterval(){if(this._statInterval)return;let e=()=>{this._pc?vn(this._pc,this._lastStat).then((t=>{this._lastStat=t;let n={inbound:{topology:An.DIRECT,transport:t.transport,rtps:t.rtps.filter((e=>"inbound-rtp"===e.type&&(e.userId=this._participantId,!0)))},outbound:{topology:An.DIRECT,transport:t.transport,rtps:t.rtps.filter((e=>"outbound-rtp"===e.type))}};this._checkBadNetwork(n),this._triggerEvent(Dn.REMOTE_DATA_STATS,n),this._statInterval=window.setTimeout(e,Rt.statisticsInterval)})):this._stopStatInterval()};this._statInterval=window.setTimeout(e,Rt.statisticsInterval)}_stopStatInterval(){this._statInterval&&(window.clearTimeout(this._statInterval),this._statInterval=null)}_checkBadNetwork(e){if(!this._signaling.ready)return;let t=e=>e.rtt<=this._networkLimits.goodNet.rtt&&e.loss<=this._networkLimits.goodNet.loss,n=e=>e.rtt>=this._networkLimits.badNet.rtt||e.loss>=this._networkLimits.badNet.loss,r=Math.round(1e3*e.outbound.transport.currentRoundTripTime)||0,o=e.inbound.rtps.reduce(((e,t)=>Math.max(e,t.packetLoss||0)),0),i={rtt:this._lastNetworkStat.rtt*(1-wn)+r*wn,loss:this._lastNetworkStat.loss*(1-wn)+o*wn},a=n(i),s=t(i),c=n(this._remoteNetworkStat),l=t(this._remoteNetworkStat),u=n(this._lastNetworkStat),d=t(this._lastNetworkStat),_=a||c?.2:s&&l?1:0,p=Date.now();if((u!==a||d!==s||p-this._lastNetworkStat.date>Rt.networkStatisticsInterval)&&(this._lastNetworkStat.date=Date.now(),this._signaling.customData({sdk:Object.assign({type:"bad-net"},i)},null).catch((e=>{Gt.warn("Unable to send [bad-net]",e)}))),_){let e={};e[this._participantId]=e[""]=_,this._triggerEvent(Dn.NETWORK_STATUS,e)}this._lastNetworkStat.rtt=i.rtt,this._lastNetworkStat.loss=i.loss}_startSettingsInterval(){if(this._settingsInterval)return;let e=()=>{this._pc?(this._applySettings(),this._settingsInterval=window.setTimeout(e,2e3)):this._stopSettingsInterval()};this._settingsInterval=window.setTimeout(e,2e3)}_stopSettingsInterval(){this._settingsInterval&&(window.clearTimeout(this._settingsInterval),this._settingsInterval=null)}_calcFingerprint(e){let t=qe.sdpFingerprint(e);null===this._fingerprint?this._fingerprint=t:(jt.onFingerprintChange(this._fingerprint.xor(t).toString()),this._fingerprint=null)}_applySettings(){var e;let t=this._mediaSource.getMediaSettings().isScreenSharingEnabled?this._serverSettings.screenSharing:this._serverSettings.camera;t&&"connected"===(null==(e=this._pc)?void 0:e.connectionState)&&(this._prevConsumerSettings=qe.applySettings(this._pc,t,this._prevConsumerSettings))}},Cn=(e=>(e.producerNotification="producerNotification",e.producerCommand="producerCommand",e.consumerScreenShare="consumerScreenShare",e.producerScreenShare="producerScreenShare",e))(Cn||{}),Sn=Cn,Tn=class extends y{constructor(e,t,n){super(),this._pc=null,this._producerNotification=null,this._producerCommand=null,this._producerScreen=null,this._consumerScreen=null,this._isOpen=!1,this._observer=!1,this._reconnectionPrevented=!1,this._state=Pn.IDLE,this._statInterval=null,this._settingsInterval=null,this._statBytes={},this._ssrcMap={},this._producerOfferIsProcessing=!1,this._producerNextOffer=null,this._prevConsumerSettings={},this._captureSender=null,this._captureReceiver=null,this._participantIdRegistry=null,this._disabledSenders=new Set,this._rtpReceiversByStreamId={},this._producerSessionId="",this._signaling=e,this._mediaSource=t,this.subscribe(this._signaling,Y.NOTIFICATION,this._onSignalingNotification.bind(this)),this.subscribe(this._mediaSource,Fe.TRACK_REPLACED,this._onReplacedTrack.bind(this)),this.subscribe(this._mediaSource,Fe.SOURCE_CHANGED,this._applyConsumerSettings.bind(this)),this.subscribe(this._mediaSource,Fe.SCREEN_STATUS,this._onScreenSharingStatus.bind(this)),this._perfStatReporter=new an(this,e),this._serverSettings=n,Gt.debug("ServerTransport: Created")}getState(){return this._state||Pn.IDLE}updateStatisticsInterval(){this._stopStatInterval();let e=this.getState();e!==Pn.IDLE&&e!==Pn.CLOSED&&e!==Pn.FAILED&&this._startStatInterval()}open(e=!1){this._isOpen?Gt.log("ServerTransport: Already opened connections"):(this._isOpen=!0,this._observer=e,this._openConnection())}close(e){this._isOpen=!1,this._closeConnection(),this.unsubscribe(),e?(Gt.error("ServerTransport: Closed",e),this._setState(Pn.FAILED)):(Gt.debug("ServerTransport: Closed"),this._setState(Pn.CLOSED))}removeParticipant(e){var t;null==(t=this._captureReceiver)||t.close(e)}preventRestart(){this._reconnectionPrevented=!0}allowRestart(){this._reconnectionPrevented=!1}updateSettings(e){Jt(e,this._serverSettings)||(this._serverSettings=e,this._applyConsumerSettings())}_closeConnection(){this._stopStatInterval(),this._stopSettingsInterval(),this._removeCaptureSender(),this._removeCaptureReceiver(),this._pc&&(this._rtpReceiversByStreamId={},this._disabledSenders.forEach((e=>{var t;return null==(t=e.track)?void 0:t.stop()})),this._disabledSenders.clear(),this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.onsignalingstatechange=null,this._participantIdRegistry=null,Tn._closeDataChannel(this._producerNotification),Tn._closeDataChannel(this._producerCommand),Tn._closeDataChannel(this._producerScreen),Tn._closeDataChannel(this._consumerScreen),this._pc.close(),this._pc=null,this._producerOfferIsProcessing=!1,this._producerNextOffer=null),this._triggerEvent(Dn.PEER_CONNECTION_CLOSED)}static _closeDataChannel(e){e&&(e.onopen=null,e.onmessage=null,e.onerror=null,e.close())}_createDataChannel(e,t,n){Gt.debug(`[${t}] data channel opening`);let r=e.createDataChannel(t,{ordered:!0});r.onopen=()=>{let e=r.readyState;"open"===e?(Gt.debug(`[${t}] data channel opened`),r.onerror=e=>{Gt.error(`[${t}] data channel error`,e)},n(r)):Gt.error(`[${t}] data channel open failed, state [${e}]`)}}_openConnection(e=!1){Gt.debug("ServerTransport: Open single connection");let t={};Et.baseChromeVersion()&&(t.sdpSemantics=Tn._isUnifiedPlanSupported()?"unified-plan":"plan-b"),this._pc=new RTCPeerConnection(t,{optional:[{googSuspendBelowMinBitrate:!1}]}),this._pc.ontrack=this._onAddTrack.bind(this,this._pc),this._pc.onconnectionstatechange=qe.throttle((e=>{this._pc&&this._onConnectionStateChange(this._pc,e)}),500),this._pc.onsignalingstatechange=Tn._onSignalingStateChange.bind(this,this._pc),Rt.producerNotificationDataChannel&&this._createDataChannel(this._pc,Sn.producerNotification,(e=>{this._producerNotification=e,this._producerNotification.binaryType="arraybuffer",this._participantIdRegistry=new class{constructor(){this.streamDescriptionByCompactId=new Map}getStreamDescription(e){return this.streamDescriptionByCompactId.get(e)}handleMessage(e){var t,n;let r=new Uint8Array(e),o=r[0],i=r.subarray(1);switch(o){case 1:let e=(0,d.decode)(i);return Object.entries(e).forEach((([e,t])=>{let n=Yt(e);this.streamDescriptionByCompactId.set(t,n)})),null;case 2:case 4:let r=(0,d.decode)(i),a=[];for(let e of r){let t=this.getStreamDescription(e);t&&a.push(t.participantId)}return 2===o?{type:"notification",notification:X.AUDIO_ACTIVITY,activeParticipants:a}:{type:"notification",notification:X.STALLED_ACTIVITY,stalledParticipants:a};case 3:let s=(0,d.decode)(i);return{type:"notification",notification:X.SPEAKER_CHANGED,speaker:null==(t=this.getStreamDescription(s))?void 0:t.participantId};case 5:let c=(0,d.decode)(i);return{type:"notification",notification:X.VIDEO_QUALITY_UPDATE,quality:{maxBitrate:c[0],maxDimension:c[1]}};case 6:let l=(0,d.decode)(i),u={};for(let[e,t]of Object.entries(l)){let r=null==(n=this.getStreamDescription(Number(e)))?void 0:n.participantId;r&&(u[r]=t/100)}return{type:"notification",notification:X.NETWORK_STATUS,statuses:u};case 7:return this._createParticipantSourcesUpdateNotification(i);default:return Gt.debug("unsupported message type: "+o),null}}_createParticipantSourcesUpdateNotification(e){let t=(0,d.decode)(e),n=[];for(let[e,r]of Object.entries(t)){let t,o=r[0],i=r[1],a=r[2];if(null!==o){if(t=this.getStreamDescription(o),!t){Gt.error(`could not uncompress participant ID ${o}`);continue}}else t=null;if(null===a){Gt.error("unexpected null sequenceNumber",e,r);continue}let s=te.PARTICIPANT_AGNOSTIC_TRACK_PREFIX+"-"+e,c=i?i>>>0:null;n.push({participantStreamDescription:t,streamId:s,rtpTimestamp:c,sequenceNumber:a})}return{type:"notification",notification:X.PARTICIPANT_SOURCES_UPDATE,participantUpdateInfos:n}}},this._signaling.setParticipantIdRegistry(this._participantIdRegistry),this._signaling.setProducerNotificationDataChannel(e)})),Rt.producerCommandDataChannel&&this._createDataChannel(this._pc,Sn.producerCommand,(e=>{this._producerCommand=e,this._signaling.setProducerCommandDataChannel(e)})),Rt.producerScreenDataChannel&&this._createDataChannel(this._pc,Sn.producerScreenShare,(e=>{this._producerScreen=e,this._producerScreen.binaryType="arraybuffer",this._createCaptureReceiver()}));try{this._mediaSource.addTrackToPeerConnection(this._pc,this._observer),this._prevConsumerSettings={},this._applyConsumerSettings()}catch(e){return Gt.error("ServerTransport: Unable to add media source tracks",e),De.log(Z.ERROR,"addTrack-single"),void this.close(e)}Rt.consumerScreenDataChannel&&this._createDataChannel(this._pc,Sn.consumerScreenShare,(e=>{this._consumerScreen=e,this._consumerScreen.binaryType="arraybuffer";let t=this._mediaSource.getScreenTrack();t&&this._createCaptureSender(t)})),e||this._allocateConsumer(),this._setState(Pn.OPENED),this._startStatInterval(),this._startSettingsInterval()}_reconnect(){this.getState()!==Pn.OPENED&&(this._setState(Pn.RECONNECTING),this._closeConnection(),this._openConnection(!0))}_signalActiveParticipants(e){this._triggerEvent(Dn.SIGNALLED_ACTIVE_PARTICIPANTS,e)}_signalStalledParticipants(e){this._triggerEvent(Dn.SIGNALLED_STALLED_PARTICIPANTS,e)}_signalSpeakerChanged(e){this._triggerEvent(Dn.SIGNALLED_SPEAKER_CHANGED,e)}_signalNetworkStatus(e){this._triggerEvent(Dn.NETWORK_STATUS,e)}_updateSSRCMap(e){e&&e.sdp.split("\n").forEach((e=>{let t=`a=ssrc:([0-9]+) label:(audio|video)-((?:[ug]?[\\d]+)|(?:mix)|(?:${te.PARTICIPANT_AGNOSTIC_TRACK_PREFIX}-[0-9]+))`,n=new RegExp(t).exec(e);n&&(this._ssrcMap[n[1]]=n[3])}))}_createCaptureSender(e){!e||!Rt.consumerScreenDataChannel||!this._consumerScreen||!this._mediaSource.getMediaSettings().isScreenSharingEnabled||(this._captureSender&&this._removeCaptureSender(),this._captureSender=new It(e,this._consumerScreen))}_removeCaptureSender(){var e;null==(e=this._captureSender)||e.destroy(),this._captureSender=null}_createCaptureReceiver(){!Rt.producerScreenDataChannel||!this._producerScreen||!this._participantIdRegistry||(this._captureReceiver&&this._removeCaptureReceiver(),this._captureReceiver=new Dt(this._producerScreen,this._participantIdRegistry,((e,t)=>{this._triggerEvent(Dn.REMOTE_STREAM_SECOND,e,t)}),(e=>{this._triggerEvent(Dn.REMOTE_STREAM_SECOND,e,null)})))}_removeCaptureReceiver(){var e;null==(e=this._captureReceiver)||e.destroy(),this._captureReceiver=null}_applyConsumerSettings(){let e=this._mediaSource.getMediaSettings().isScreenSharingEnabled&&!Rt.consumerScreenDataChannel?this._serverSettings.screenSharing:this._serverSettings.camera;if(e&&this._pc){let t=[];this._pc.getSenders().forEach((n=>{if(!n.track||n.track.kind!==We.video)return;let r=!this._disabledSenders.has(n),o=0!==e.maxDimension;if(r&&!o)return Gt.log("Disabling video upload"),this._disabledSenders.add(n),void n.replaceTrack(Et.getBlackMediaTrack()).catch((e=>{Gt.error("Could not disable video upload",e)}));let i=this._mediaSource.getSendVideoTrack();if(!r&&o&&i){Gt.log("Enabling video upload"),this._disabledSenders.delete(n);let e=n.track;e.enabled=i.enabled,n.replaceTrack(i).then((()=>e.stop())).catch((e=>{Gt.error("Could not enable video upload",e)}))}qe.applyVideoTrackSettings(e,n,null!=i?i:n.track,this._prevConsumerSettings,t)})),this._prevConsumerSettings=t}}_onScreenSharingStatus(e){e.track?this._createCaptureSender(e.track):this._removeCaptureSender()}_setState(e){this._state!==e&&(this._state=e,this._triggerEvent(Dn.STATE_CHANGED,e))}_startStatInterval(){if(this._statInterval)return;let e=()=>{this._pc?(this._collectStat().then((e=>{this._reportStats(e),this._detectStaleTracks(e)})).catch((()=>{})),this._statInterval=window.setTimeout(e,Rt.statisticsInterval)):this._stopStatInterval()};this._statInterval=window.setTimeout(e,Rt.statisticsInterval)}_stopStatInterval(){this._statInterval&&(window.clearTimeout(this._statInterval),this._statInterval=null),this._statBytes={}}_startSettingsInterval(){if(this._settingsInterval)return;let e=()=>{this._pc?(this._applyConsumerSettings(),this._settingsInterval=window.setTimeout(e,2e3)):this._stopSettingsInterval()};this._settingsInterval=window.setTimeout(e,2e3)}_stopSettingsInterval(){this._settingsInterval&&(window.clearTimeout(this._settingsInterval),this._settingsInterval=null)}_collectStat(){return v(this,null,(function*(){if(!this._pc)return Promise.reject();let e=yield vn(this._pc,this._lastStat,this._ssrcMap);return this._lastStat=e,e}))}_reportStats(e){this._triggerEvent(Dn.REMOTE_DATA_STATS,{inbound:{topology:An.SERVER,transport:e.transport,rtps:e.rtps.filter((e=>"inbound-rtp"===e.type))},outbound:{topology:An.SERVER,transport:e.transport,rtps:e.rtps.filter((e=>"outbound-rtp"===e.type))}})}_detectStaleTracks(e){let t=e.rtps.find((e=>"inbound-rtp"===e.type&&"audio"===e.kind&&"mix"===this._ssrcMap[e.ssrc]));if(!t)return;let n=te.AUDIO_MIX,r=this._statBytes[n],o=!1;if(r){let e=t.bytesReceived-r.bytesReceived;e>=0&&e<=5&&(o=!0),r.stalled!==o&&this._triggerEvent(Dn.REMOTE_ALL_STALL,o)}this._statBytes[n]={bytesReceived:t.bytesReceived,stalled:o}}_allocateConsumer(){if(!this._signaling.ready)return;let e={estimatedPerformanceIndex:an.getEstimatedPerformanceIndex(),audioMix:!0,consumerUpdate:!0,producerNotificationDataChannelVersion:Rt.producerNotificationDataChannel?6:0,producerCommandDataChannelVersion:Rt.producerCommandDataChannel?2:0,consumerScreenDataChannelVersion:Rt.consumerScreenDataChannel?1:0,producerScreenDataChannelVersion:Rt.producerScreenDataChannel?1:0,onDemandTracks:!0,unifiedPlan:Tn._isUnifiedPlanSupported(),singleSession:!0,videoTracksCount:Rt.videoTracksCount};this._signaling.allocateConsumer(null,e)}_acceptProducer(e){return v(this,null,(function*(){if(this._producerOfferIsProcessing)return this._producerNextOffer=e,void Gt.debug("[single] wait until other remote offer is processed");this._producerOfferIsProcessing=!0;let t=new RTCSessionDescription({type:"offer",sdp:e});if(Gt.debug("[single] set remote offer",{offer:t}),!this._pc)throw new Error("Interrupt allocation");this._pc.setRemoteDescription(t).catch((e=>{throw Gt.error("[single] unable to set remote offer",e),De.log(Z.ERROR,"setRemoteDescription-single"),e})).then((()=>v(this,null,(function*(){if(Gt.debug("[single] create local answer"),!this._pc)throw new Error("Interrupt allocation");return this._pc.createAnswer()})))).catch((e=>{throw Gt.error("[single] unable to create answer",e),De.log(Z.ERROR,"createAnswer-single"),e})).then((e=>(e.sdp=qe.patchSDP(e.sdp,!1,Et.isBrokenH264(),!1),e))).then((e=>v(this,null,(function*(){if(Gt.debug("[single] set local answer",{answer:e}),!this._pc)throw new Error("Interrupt allocation");return yield this._pc.setLocalDescription(e),e})))).catch((e=>{throw Gt.error("[single] unable to set local answer",e),De.log(Z.ERROR,"setLocalDescription-single"),e})).then((e=>v(this,null,(function*(){Gt.debug("[single] transmit local answer",{answer:e}),this._updateSSRCMap(t),yield this._signaling.acceptProducer(e,Object.keys(this._ssrcMap)),Gt.debug("[single] remote offer has been processed")})))).catch((e=>{Gt.warn("[single] unable to send local answer",e),De.log(Z.ERROR,"acceptProducer")})).then((()=>v(this,null,(function*(){if(this._producerOfferIsProcessing=!1,this._producerNextOffer){Gt.debug("[single] there is other unprocessed remote offer, process it");let e=this._producerNextOffer;return this._producerNextOffer=null,this._acceptProducer(e)}})))).catch((e=>this.close(e)))}))}_onSignalingNotification(e){return v(this,null,(function*(){if(this._isOpen)switch(e.notification){case X.PRODUCER_UPDATED:yield this._onProducerUpdated(e);break;case X.REALLOC_CON:this._reconnect();break;case X.AUDIO_ACTIVITY:this._signalActiveParticipants(e.activeParticipants);break;case X.SPEAKER_CHANGED:this._signalSpeakerChanged(e.speaker);break;case X.STALLED_ACTIVITY:this._signalStalledParticipants(e.stalledParticipants);break;case X.NETWORK_STATUS:this._signalNetworkStatus(e.statuses)}}))}_onProducerUpdated(e){return v(this,null,(function*(){this._producerSessionId&&this._producerSessionId!==e.sessionId&&this._reconnect(),Rt.breakVideoPayloadTypes&&(Gt.log("test mode enabled, video switched off"),this._signaling.requestTestMode("breakVideoPayloadTypes")),this._producerSessionId=e.sessionId,yield this._acceptProducer(e.description)}))}_onAddTrack(e,t){Gt.debug("[single] remote track (added)",{track:t.track});let n=t.streams[0];n?(n.onremovetrack||(n.onremovetrack=e=>{this._triggerEvent(Dn.REMOTE_TRACK_REMOVED,n.id,n,e.track)}),n.getTracks().find((e=>e.id===t.track.id))||n.addTrack(t.track),this._rtpReceiversByStreamId[n.id]=t.receiver,this._triggerEvent(Dn.REMOTE_TRACK_ADDED,n.id,n,t.track)):Gt.error("[single] unable to get media stream from track event")}static _onSignalingStateChange(e,t){Gt.debug("[single] signaling state changed",{state:e.signalingState},t)}_onConnectionStateChange(e,t){switch(Gt.debug("[single] connection state changed",{state:e.connectionState},t),De.log(Z.ICE_CONNECTION_STATE,e.connectionState),e.connectionState){case"failed":this._reconnectionPrevented?this.close(new Error("Ice connection failed")):this._reconnect();break;case"connecting":let t=this.getState();t===Pn.IDLE||t===Pn.OPENED?this._setState(Pn.CONNECTING):"checking"===e.iceConnectionState&&this._setState(Pn.RECONNECTING);break;case"disconnected":this._reconnectionPrevented?this.close(new Error("Ice connection disconnected")):this._setState(Pn.RECONNECTING);break;case"connected":this._setState(Pn.CONNECTED),qe.getPeerConnectionHostInfo(e).then((e=>{e&&De.log(Z.ICE_CONNECTION_TYPE,e.type)}))}}_onReplacedTrack(e,t){this._pc&&(Rt.consumerScreenDataChannel&&t&&(e=t),this._pc.getSenders().forEach((t=>{t.track&&t.track.kind===e.kind&&!this._disabledSenders.has(t)&&(t.track.enabled=e.enabled,t.replaceTrack(e).catch((e=>{Gt.error("ServerTransport: Unable to replace track",e),De.log(Z.ERROR,"replaceTrack-single")})))}))),this._applyConsumerSettings()}static _isUnifiedPlanSupported(){let e=Et.baseChromeVersion();return e?Rt.isUnifiedPlanSupported("Chrome",e):Rt.isUnifiedPlanSupported(Et.browserName(),Number(Et.browserVersion()))}getStreamWaitingTimeMs(e,t){if(!this._pc)return De.log(Z.PAT_WAITING_TIME_ERROR,"noConnection"),Gt.error("Cannot get stream waiting time, peer connection is not initialized"),0;let n=this._rtpReceiversByStreamId[e];if(!n)return De.log(Z.PAT_WAITING_TIME_ERROR,"noReceiver"),Gt.error(`Cannot get stream waiting time, cannot find RTP receiver by stream ID: ${e}`),0;let r=n.getSynchronizationSources();if(!r||!r.length)return Gt.log(`Cannot get stream waiting time, ${e} receiver has no synchronization sources`),0;let o=r[0].rtpTimestamp;if(!Number.isInteger(o))return De.log(Z.PAT_WAITING_TIME_ERROR,"timestampNotInteger"),Gt.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${o}`),0;let i=t-o&4294967295,a=Math.ceil(i/90);return Math.min(100,Math.max(0,a))}},Dn=(e=>(e.REMOTE_TRACK_ADDED="REMOTE_TRACK_ADDED",e.REMOTE_TRACK_REMOVED="REMOTE_TRACK_REMOVED",e.REMOTE_STREAM_SECOND="REMOTE_STREAM_SECOND",e.REMOTE_ALL_STALL="REMOTE_ALL_STALL",e.REMOTE_DATA_STATS="REMOTE_DATA_STATS",e.STATE_CHANGED="STATE_CHANGED",e.LOCAL_STATE_CHANGED="LOCAL_STATE_CHANGED",e.SIGNALLED_ACTIVE_PARTICIPANTS="SIGNALLED_ACTIVE_PARTICIPANTS",e.ACTIVE_PARTICIPANTS_NO_SIGNAL="ACTIVE_PARTICIPANTS_NO_SIGNAL",e.SIGNALLED_SPEAKER_CHANGED="SIGNALLED_SPEAKER_CHANGED",e.SIGNALLED_STALLED_PARTICIPANTS="SIGNALLED_STALLED_PARTICIPANTS",e.TOPOLOGY_CHANGED="TOPOLOGY_CHANGED",e.NETWORK_STATUS="NETWORK_STATUS",e.PEER_CONNECTION_CLOSED="PEER_CONNECTION_CLOSED",e))(Dn||{}),Pn=((yn=Pn||{}).IDLE="IDLE",yn.OPENED="OPENED",yn.CONNECTING="CONNECTING",yn.RECONNECTING="RECONNECTING",yn.CONNECTED="CONNECTED",yn.CLOSED="CLOSED",yn.FAILED="FAILED",yn),An=(e=>(e.DIRECT="DIRECT",e.SERVER="SERVER",e))(An||{}),kn=class extends y{constructor(e,t,n,r){super(),this._allocated=[],this._opened=[],this._directTransport=null,this._serverTransport=null,this._dtListeners=[],this._stListeners=[],this._states={},this._localState="IDLE",this._signaling=t,this._mediaSource=n,this._topology=e,this._serverSettings=r,this.subscribe(this._signaling,Y.NOTIFICATION,this._onSignalingNotification.bind(this)),"SERVER"===e&&(this._serverTransport=this._createServerTransport())}updateSettings(e){this._serverSettings=e,this._directTransport&&this._directTransport.updateSettings(e),this._serverTransport&&this._serverTransport.updateSettings(e)}updateStatisticsInterval(){this._directTransport&&this._directTransport.updateStatisticsInterval(),this._serverTransport&&this._serverTransport.updateStatisticsInterval()}allocate(e,t=!1){-1===this._allocated.indexOf(e)?(this._allocated.push(e),"DIRECT"===this._topology&&!this._directTransport&&(this._directTransport=this._createDirectTransport(e,t)),"SERVER"===this._topology&&!this._serverTransport&&(this._serverTransport=this._createServerTransport())):Gt.warn(`The participant [${e}] has already had allocated transport`)}open(e,t=null,n=!1){let r=!1;for(let t of e)-1===this._opened.indexOf(t)?-1!==this._allocated.indexOf(t)?(this._opened.push(t),r=!0):Gt.warn(`The participant [${t}] has no allocated transport`):Gt.warn(`The participant [${t}] has already had opened transport`);!r||("DIRECT"===this._topology&&this._directTransport&&this._directTransport.open(t),"SERVER"===this._topology&&this._serverTransport&&(this._serverTransport.open(n),this._setStates(e,this._serverTransport.getState()),this._setLocalState(this._serverTransport.getState())),Gt.debug("The transport has been opened",e))}close(e){var t;let n=this._allocated.indexOf(e),r=this._opened.indexOf(e);n<0&&Gt.warn(`The participant [${e}] transport has already deallocated`),"DIRECT"===this._topology&&this._directTransport&&(this._directTransport.close(),this._directTransport=null),"SERVER"===this._topology&&(null==(t=this._serverTransport)||t.removeParticipant(e),this._setState(e,"CLOSED")),r>=0&&this._opened.splice(r,1),n>=0&&this._allocated.splice(n,1)}destroy(){this.unsubscribe(),this._dtListeners&&this._dtListeners.forEach((e=>{e.dispose()})),this._stListeners&&this._stListeners.forEach((e=>{e.dispose()})),this._directTransport&&(this._directTransport.close(),this._directTransport=null),this._serverTransport&&(this._serverTransport.close(),this._serverTransport=null),this._allocated=[],this._opened=[]}getTopology(){return this._topology}isAllocated(e){return this._allocated.indexOf(e)>=0}allocated(){return this._allocated.slice()}opened(){return this._opened.slice()}_setStates(e,t){let n=e.filter((e=>this._states[e]!==t&&(this._states[e]=t,!0)));n.length&&this._triggerEvent("STATE_CHANGED",n,t)}_setState(e,t){this._states[e]!==t&&(this._states[e]=t,this._triggerEvent("STATE_CHANGED",[e],t))}_setLocalState(e){this._localState!==e&&(this._localState=e,this._triggerEvent("LOCAL_STATE_CHANGED",e))}_onSignalingNotification(e){return e.notification===X.TOPOLOGY_CHANGED?this._onTopologyChanged(e):e.notification===X.RECORD_STARTED?this._onRecordStarted(e):void 0}_onTopologyChanged(e){var t;if(e.topology!==this._topology){if(Gt.log(`Topology changed ${this._topology} -> ${e.topology}`),De.log(Z.TOPOLOGY_CHANGE_REQUESTED,e.topology),this._topology=e.topology,"SERVER"===this._topology&&(this._serverTransport?this._serverTransport.allowRestart():(this._serverTransport=this._createServerTransport(),this._opened.length>0&&(null==(t=this._directTransport)||t.preventRestart(),this._serverTransport.open()))),"DIRECT"===this._topology){let t=e.offerTo||[],n=e.offerToTypes||[],r=e.offerToDeviceIdxs||[],o=t.length&&n.length?qe.composeParticipantId(t[0],n[0],r[0]):null;if(this._serverTransport&&this._serverTransport.preventRestart(),!this._allocated||0===this._allocated.length)return void Gt.error("Topology changed to DIRECT, but the list of allocated participants is empty");this._allocated.length>1&&Gt.warn("Topology changed to DIRECT, but the allocated participants count more then one");let i=this._allocated[0];if(this._directTransport)this._directTransport.allowRestart();else{let e=o===i;this._directTransport=this._createDirectTransport(i,e)}this._opened.indexOf(i)>=0&&this._directTransport.open()}this._triggerEvent("TOPOLOGY_CHANGED",this._topology)}}_onRecordStarted(e){this._serverTransport&&this._serverTransport.open()}_createDirectTransport(e,t=!1){let n=new bn(e,t,this._signaling,this._mediaSource,this._serverSettings);return this._setLocalNoiseSuppression(!0),this._dtListeners&&this._dtListeners.length>0&&Gt.warn(`The list of direct listeners for the participant [${e}] is not empty`),this._dtListeners=[],this._dtListeners.push(n.addEventListener("REMOTE_TRACK_ADDED",this._onDirectRemoteTrackAdded.bind(this,e)),n.addEventListener("REMOTE_TRACK_REMOVED",this._onDirectRemoteTrackRemoved.bind(this,e)),n.addEventListener("REMOTE_DATA_STATS",this._onDirectRemoteDataStats.bind(this)),n.addEventListener("STATE_CHANGED",this._onDirectTransportChanged.bind(this,e)),n.addEventListener("NETWORK_STATUS",this._onTransportNetworkStatus.bind(this)),n.addEventListener("PEER_CONNECTION_CLOSED",this._onPeerConnectionClosed.bind(this,"DIRECT"))),n}_createServerTransport(){let e=new Tn(this._signaling,this._mediaSource,this._serverSettings);return this._setLocalNoiseSuppression(!1),this._stListeners&&this._stListeners.length>0&&Gt.warn("The list of server transport listeners is not empty"),this._stListeners=[],this._stListeners.push(e.addEventListener("REMOTE_TRACK_ADDED",this._onServerRemoteTrackAdded.bind(this)),e.addEventListener("REMOTE_TRACK_REMOVED",this._onServerRemoteTrackRemoved.bind(this)),e.addEventListener("REMOTE_ALL_STALL",this._onServerRemoteAllStall.bind(this)),e.addEventListener("REMOTE_DATA_STATS",this._onServerRemoteDataStats.bind(this)),e.addEventListener("STATE_CHANGED",this._onServerTransportChanged.bind(this)),e.addEventListener("ACTIVE_PARTICIPANTS_NO_SIGNAL",this._onTransportActiveParticipantsNoSignal.bind(this)),e.addEventListener("SIGNALLED_ACTIVE_PARTICIPANTS",this._onTransportActiveParticipants.bind(this)),e.addEventListener("SIGNALLED_SPEAKER_CHANGED",this._onTransportSpeakerChanged.bind(this)),e.addEventListener("SIGNALLED_STALLED_PARTICIPANTS",this._onTransportStalledParticipants.bind(this)),e.addEventListener("NETWORK_STATUS",this._onTransportNetworkStatus.bind(this)),e.addEventListener("REMOTE_STREAM_SECOND",this._onRemoteStreamSecond.bind(this)),e.addEventListener("PEER_CONNECTION_CLOSED",this._onPeerConnectionClosed.bind(this,"SERVER"))),e}_releaseDirectTransport(e){this._directTransport&&(e&&this._directTransport.close(),this._directTransport=null),this._dtListeners&&(this._dtListeners.forEach((e=>{e.dispose()})),this._dtListeners=[])}_releaseServerTransport(e){this._serverTransport&&(e&&this._serverTransport.close(),this._serverTransport=null),this._stListeners&&(this._stListeners.forEach((e=>{e.dispose()})),this._stListeners=[])}_setLocalNoiseSuppression(e){var t;Rt.noiseSuppression!==e&&(Rt.noiseSuppression=e,null==(t=this._mediaSource)||t.updateNoiseSuppression())}_onDirectTransportChanged(e,t){if("CONNECTED"===t&&"DIRECT"===this._topology&&this._releaseServerTransport(!0),("CLOSED"===t||"FAILED"===t)&&(this._releaseDirectTransport(!1),"DIRECT"===this._topology)){let t=this._opened.indexOf(e);t>=0&&this._opened.splice(t,1);let n=this._allocated.indexOf(e);n>=0&&this._allocated.splice(n,1)}"DIRECT"===this._topology&&(this._setState(e,t),this._setLocalState(t))}_onServerTransportChanged(e){let t=this._opened.slice();"CONNECTED"===e&&"SERVER"===this._topology&&this._releaseDirectTransport(!0),("CLOSED"===e||"FAILED"===e)&&(this._releaseServerTransport(!1),"SERVER"===this._topology&&(this._allocated=[],this._opened=[])),"SERVER"===this._topology&&(this._setStates(t,e),this._setLocalState(e))}_onTransportActiveParticipantsNoSignal(){this._triggerEvent("ACTIVE_PARTICIPANTS_NO_SIGNAL")}_onTransportActiveParticipants(e){"SERVER"===this._topology&&this._triggerEvent("SIGNALLED_ACTIVE_PARTICIPANTS",e)}_onTransportStalledParticipants(e){"SERVER"===this._topology&&this._triggerEvent("SIGNALLED_STALLED_PARTICIPANTS",e)}_onTransportSpeakerChanged(e){"SERVER"===this._topology&&this._triggerEvent("SIGNALLED_SPEAKER_CHANGED",e)}_onTransportNetworkStatus(e){this._triggerEvent("NETWORK_STATUS",e)}_onRemoteStreamSecond(e,t){this._triggerEvent("REMOTE_STREAM_SECOND",e,t)}_onPeerConnectionClosed(e){this._triggerEvent("PEER_CONNECTION_CLOSED",e)}_onServerRemoteAllStall(e){"SERVER"===this._topology&&this._triggerEvent("REMOTE_ALL_STALL",e)}_onServerRemoteDataStats(e){this._triggerEvent("REMOTE_DATA_STATS",e)}_onDirectRemoteTrackAdded(e,t,n){this._triggerEvent("REMOTE_TRACK_ADDED",e,t,n)}_onDirectRemoteTrackRemoved(e,t,n){this._triggerEvent("REMOTE_TRACK_REMOVED",e,t,n)}_onDirectRemoteDataStats(e){this._triggerEvent("REMOTE_DATA_STATS",e)}_onServerRemoteTrackAdded(e,t,n){this._triggerEvent("REMOTE_TRACK_ADDED",e,t,n)}_onServerRemoteTrackRemoved(e,t,n){this._triggerEvent("REMOTE_TRACK_REMOVED",e,t,n)}getStreamWaitingTimeMs(e,t){return"SERVER"!==this._topology?(De.log(Z.PAT_WAITING_TIME_ERROR,"wrongTopology"),Gt.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`),0):this._serverTransport?this._serverTransport.getStreamWaitingTimeMs(e,t):(De.log(Z.PAT_WAITING_TIME_ERROR,"noTransport"),Gt.error("Cannot get stream waiting time, server transport is not initialized"),0)}},In=((En=In||{}).VOLUMES_DETECTED="VOLUMES_DETECTED",En),On=class extends y{constructor(e){super(),this._detector=null,this._interval=null,this.subscribe(e,Dn.REMOTE_TRACK_ADDED,this._onRemoteTrackAdded.bind(this)),this.subscribe(e,Dn.REMOTE_TRACK_REMOVED,this._onRemoteTrackRemoved.bind(this)),this.subscribe(e,Dn.SIGNALLED_ACTIVE_PARTICIPANTS,this._onSignalledActiveParticipants.bind(this)),this.subscribe(e,Dn.ACTIVE_PARTICIPANTS_NO_SIGNAL,this._onActiveParticipantsNoSignal.bind(this))}destroy(){var e;this._interval&&(window.clearTimeout(this._interval),this._interval=null),this.unsubscribe(),null==(e=this._detector)||e.destroy(),this._detector=null}_onRemoteTrackAdded(e,t,n){var r;if(n.kind===We.audio&&(null==(r=this._detector)||r.destroy(),this._detector=new nn(e,t),!this._interval)){let e=()=>{this._collectVolumes(),this._interval=window.setTimeout(e,Rt.voiceParams.interval)};this._interval=window.setTimeout(e,Rt.voiceParams.interval)}}_onRemoteTrackRemoved(e,t,n){n.kind===We.audio&&(!this._detector||this._detector.stream!==t||(this._detector.destroy(),this._detector=null))}_collectVolumes(){if(!this._detector)return;let e={},t=this._detector.trackId,n=this._detector.getLevel();if(t===te.AUDIO_MIX){if(this._activeParticipants)for(let t of this._activeParticipants)e[t]=n}else e[t]=n;this._triggerEvent("VOLUMES_DETECTED",e)}_onSignalledActiveParticipants(e){this._activeParticipants=e}_onActiveParticipantsNoSignal(){this._activeParticipants=null}},xn=(e=>(e.SPEAKER_CHANGED="SPEAKER_CHANGED",e))(xn||{}),Rn=class extends y{constructor(e,t){super(),this._speakerId=null,this._serverAudioActivityAvailable=!1,this.subscribe(e,In.VOLUMES_DETECTED,this._onVolumesDetected.bind(this)),this.subscribe(t,Dn.SIGNALLED_SPEAKER_CHANGED,this._onServerSpeakerChanged.bind(this)),this.subscribe(t,Dn.SIGNALLED_ACTIVE_PARTICIPANTS,this._onReceivedServerAudioActivity.bind(this)),this.subscribe(t,Dn.ACTIVE_PARTICIPANTS_NO_SIGNAL,this._onStoppedReceivingServerAudioActivity.bind(this))}destroy(){this.unsubscribe()}_onVolumesDetected(e){if(this._serverAudioActivityAvailable)return;let t=0,n=null;if(Object.keys(e).forEach((r=>{let o=e[r].smoothed;o>t&&o>Rt.voiceParams.threshold&&(t=o,n=r)})),n&&n!==this._speakerId){let r=this._speakerId&&e.hasOwnProperty(this._speakerId)?e[this._speakerId].smoothed:0;t>r*Rt.voiceParams.speakerLevelMultiplier&&(this._speakerId=n,this._triggerEvent("SPEAKER_CHANGED",n))}}_onServerSpeakerChanged(e){this._serverAudioActivityAvailable&&this._triggerEvent("SPEAKER_CHANGED",e)}_onReceivedServerAudioActivity(){this._serverAudioActivityAvailable=!0}_onStoppedReceivingServerAudioActivity(){this._serverAudioActivityAvailable=!1}},Mn=class extends y{constructor(e,t,n){super(),this._states={},this._volumes={},this._participants={},this._connectionTimeout=0,this._volumeTimeout=0,this._transport=e,this._participants=n,this.subscribe(e,Dn.STATE_CHANGED,this._onTransportStateChanged.bind(this)),this.subscribe(t,In.VOLUMES_DETECTED,this._onVolumesDetected.bind(this))}destroy(){this.unsubscribe(),this._connectionTimeout&&window.clearTimeout(this._connectionTimeout),this._volumeTimeout&&window.clearTimeout(this._volumeTimeout)}onChangeRemoteMediaSettings(e,t){t.isAudioEnabled||(this._volumes[e]=1),t.isAudioEnabled&&(this._volumes[e]=0)}_onTransportStateChanged(e,t){e.forEach((e=>this._states[e]=t)),t===Pn.OPENED&&(this._connectionTimeout||(this._connectionTimeout=window.setTimeout(this._onConnectionTimeout.bind(this),Rt.specListenerParams.connectionTimeout)),this._volumeTimeout||(this._volumeTimeout=window.setTimeout(this._onVolumeTimeout.bind(this),Rt.specListenerParams.volumeTimeout))),t===Pn.FAILED&&this._connectionTimeout&&(Gt.warn("Transport failed, send callSpecError"),De.log(Z.CALL_SPEC_ERROR,`${this._transport.getTopology()}_CONNECTION_TIMEOUT`))}_onVolumesDetected(e){Object.keys(e).forEach((t=>{this._volumes[t]=Math.max(e[t].real,this._volumes[t]||0)}))}_onConnectionTimeout(){let e=e=>e!==Pn.CONNECTED;(()=>Object.values(this._states).filter(e).length>0)()&&(Gt.warn("There is not connected transport, send callSpecError"),De.log(Z.CALL_SPEC_ERROR,`${this._transport.getTopology()}_CONNECTION_TIMEOUT`)),this._connectionTimeout=0}_onVolumeTimeout(){let e=[];Object.keys(this._volumes).forEach((t=>{if(this._volumes[t]>0)return;let n="UNKNOWN",r=this._participants[t];r&&r.platform&&(n=r.platform),e.indexOf(n)<0&&(e.push(n),De.log(Z.CALL_SPEC_ERROR,`${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`))})),e.length&&Gt.warn("There is silent participant, send callSpecError"),this._volumeTimeout=0}},Ln=class extends y{constructor(e,t,n){super(),this._mediaSource=null,this._conversation=null,this._state="IDLE",this._participantState=G.CALLED,this._participants={},this._transport=null,this._debugInfo=null,this._volumesDetector=null,this._speakerDetector=null,this._localVolumeDetector=null,this._specListener=null,this._activeSpeakerId=null,this._lastSignalledActiveSpeakerId=null,this._serverSettings={camera:null,screenSharing:null},this._lastStalled={},this._remoteAllStalled=!1,this._audioFix=null,this._streamByStreamId=new Map,this._streamIdByStreamDescription=new Map,this._streamWaitTimerByStreamDescription=new Map,this._sequenceNumberByStreamDescription=new Map,this._cooldownTimestampByStreamDescription=new Map,this._cooldownQueueCleanupTimer=null,De.create(e,n),this._api=e,this._signaling=t,this._onUnload=()=>{this._conversation&&this._api&&this._api.hangupConversation(this._conversation.id),De.destroy()},window.addEventListener("unload",this._onUnload),this._audioOutput=new class{constructor(){this._output=null,this._volume=1,this._features={setSinkId:!!Audio.prototype.setSinkId}}add(e){this.destroy(),this._output={},this._output.audioTrack=e,this._initAudioElement()}remove(e){!this._output||this._output.audioTrack!==e||this.destroy()}get volume(){return this._volume}set volume(e){this._volume=Math.max(0,Math.min(1,e)),this._output&&this._output.audioElement&&(this._output.audioElement.volume=this._volume)}_initAudioElement(){var e;if(!(null==(e=this._output)?void 0:e.audioTrack))return;let t="Safari"!==Et.browserName(),n=document.createElement(t?"audio":"video");n.muted=!1,n.volume=this._volume,n.preload="auto";let r=()=>{Gt.warn("Error on play audio"),jt.onAutoplayError()},o=e=>{n.srcObject=new MediaStream([e]),n.load();let t=n.play();t?t.catch(r):r()},i=()=>{var e;Gt.debug("Recover audio playback");let t=null==(e=this._output)?void 0:e.audioTrack;t?o(t):Gt.warn("Broken audio track")};n.onpause=i,n.onstalled=i,n.onerror=i,o(this._output.audioTrack),this._output.audioElement=n}_stopAudioElement(){var e,t,n;(null==(e=this._output)?void 0:e.audioElement)&&(this._output.audioElement.pause(),this._output.audioElement.srcObject=null),null==(n=null==(t=this._output)?void 0:t.audioTrack)||n.stop()}destroy(){!this._output||(this._stopAudioElement(),this._output=null)}changeOutput(){return v(this,null,(function*(){var e,t,n;try{if(!this._features.setSinkId)throw new Error('Feature "setSinkId" is not supported');if(!(null==(e=this._output)?void 0:e.audioElement))throw new Error("Audio Element is not initialized");let r=Et.getSavedOutput();r&&(yield null==(n=(t=this._output.audioElement).setSinkId)?void 0:n.call(t,r.deviceId))}catch(e){throw De.log(Z.ERROR,"change_output"),Gt.error("Output change failed",e),e}}))}},Rt.videoTracksCount>0&&(this._cooldownQueueCleanupTimer=window.setInterval(this._cleanupCooldownQueue.bind(this),1e3))}static current(){return Ln._current}static hangupAfterInit(){Ln._activationMutex&&!Ln._current&&(Ln._delayedHangup=!0)}static id(){var e,t;return(null==(t=null==(e=Ln._current)?void 0:e._conversation)?void 0:t.id)||null}onStart(e,t,n,r="",o=!1,i=!1){return v(this,null,(function*(){if(Ln._activationMutex)throw De.log(Z.ERROR,"startCall"),Gt.warn("Conversation: there is already running activation"),new Ue(F.FAILED);Ln._activationMutex=!0;try{this._mediaSource=this._createMediaSource(),yield this._mediaSource.request(n);let a=this._mediaSource.getMediaSettings();t===S.CHAT||e.length>1?this._logWithMediaSettings(Z.OUTGOING_MULTIPARTY_CALL,a):this._logWithMediaSettings(Z.OUTGOING_CALL,a);let s=yield this._startConversation(e,t,b.OUTGOING,n,r,o,i);if(!this._conversation)throw new Ue(F.UNKNOWN_ERROR);if(this._participantState=G.ACCEPTED,this._signaling.changeMediaSettings(a),yield this._registerParticipants(s.conversation.participants),this._processConnectionData(s),this._allocateTransport(),this._createSpeakerDetector(),this._createSpecListener(),this._signaling.readyToSend(),Ln._delayedHangup)throw new Ue(F.CANCELED);Gt.debug("Outgoing call",{opponentIds:e,opponentType:t,mediaOptions:n});let c,l=Object.values(this._participants);return Rt.batchParticipantsOnStart&&(c=qe.mapSharedParticipants(l)),jt.onLocalStream(this._mediaSource.getStream(),this._mediaSource.getMediaSettings()),jt.onConversation(this._conversation.externalId,this._conversation.mediaModifiers,this._conversation.muteStates,c),jt.onLocalStatus(Nt.WAITING),this._toggleJoinAvailability(),this._changeFeatureSet(),this._changeNeedRate(),Ln._current=this,this._conversation.concurrent?yield this._acceptConcurrent():Rt.batchParticipantsOnStart||this._setParticipantsStatus(l,Nt.WAITING),this._conversation}catch(e){throw this._close(e,"Unable to start conversation"),e}finally{Ln._activationMutex=!1}}))}onJoin(e){return v(this,null,(function*(){var t;if(Ln._activationMutex)throw De.log(Z.ERROR,"joinCall"),Gt.warn("Conversation: there is already running activation"),new Ue(F.FAILED);Ln._activationMutex=!0,this._state="PROCESSING";try{let n=!!(null==(t=e.observedIds)?void 0:t.length);this._mediaSource=this._createMediaSource(),yield this._mediaSource.request(e.mediaOptions,!n);let r=this._mediaSource.getMediaSettings();this._logWithMediaSettings(Z.JOIN_CONVERSATION,r);let o=yield this._joinConversation(e);if(!this._conversation)throw new Ue(F.UNKNOWN_ERROR);return this._conversation.observer=n,jt.onLocalStream(this._mediaSource.getStream(),r),this._conversation.waitingHall?(Gt.log("In waiting hall"),Ln._current=this,Ln._activationMutex=!1,this._signaling.readyToSend(),jt.onLocalStatus(Nt.WAITING_HALL),this._conversation):this._onJoinPart2(o)}catch(e){throw Ln._activationMutex=!1,this._close(e,"Unable to join conversation"),e}}))}_onJoinPart2(e){return v(this,null,(function*(){Gt.debug("Join conversation part 2"),Ln._activationMutex=!0;try{if(this._participantState=G.ACCEPTED,!this._conversation||!this._mediaSource)throw new Ue(F.UNKNOWN_ERROR);if(this._conversation.observer||this._signaling.changeMediaSettings(this._mediaSource.getMediaSettings()),yield this._registerParticipants(e.conversation.participants),this._processConnectionData(e),this._allocateTransport(),this._createSpeakerDetector(),this._createSpecListener(),this._signaling.readyToSend(),Ln._delayedHangup)throw new Ue(F.CANCELED);let t,n=Object.values(this._participants);return Rt.batchParticipantsOnStart&&(t=qe.mapSharedParticipants(n)),jt.onConversation(this._conversation.externalId,this._conversation.mediaModifiers,this._conversation.muteStates,t),jt.onLocalStatus(Nt.WAITING),this._toggleJoinAvailability(),this._changeNeedRate(),this._state="ACTIVE",this._changeFeatureSet(),Ln._current=this,Rt.batchParticipantsOnStart||this._setParticipantsStatus(n,Nt.WAITING),this._openTransport(n,!1),this._conversation}catch(e){throw this._close(e,"Unable to join conversation"),e}finally{Ln._activationMutex=!1}}))}onPush(e){return v(this,arguments,(function*(e,t=ce.USER,n){if(Ln._activationMutex)throw Gt.warn("Conversation: there is already running activation"),new Ue(F.REJECTED);Ln._activationMutex=!0;try{let r=yield this._prepareConversation(e,t,n);if(this._mediaSource=this._createMediaSource(),!this._conversation)throw new Ue(F.UNKNOWN_ERROR);if(!r.conversation.participants.find((e=>{var t;return e.state===G.CALLED&&e.id===(null==(t=this._conversation)?void 0:t.userId)})))throw Gt.log("Push rejected (there is an active call)"),De.log(Z.PUSH,"rejected"),new Ue(F.REJECTED);if(yield this._registerParticipants(r.conversation.participants),this._processConnectionData(r),this._allocateTransport(),this._createSpeakerDetector(),this._createSpecListener(),this._signaling.readyToSend(),De.log(Z.PUSH,"accepted"),Ln._current=this,Ln._delayedHangup)throw new Ue(F.CANCELED);Ln._activationMutex=!1}catch(e){throw Ln._activationMutex=!1,this._close(e,"Unable to handle inbound call push"),e}}))}_isInWaitingHall(e){if(!e.conversation||(e.conversation.options||[]).indexOf(I.WAITING_HALL)<0)return!1;let t=(e.conversation.participants||[]).find((t=>qe.comparePeerId(t.peerId,e.peerId)));return t&&t.restricted||!1}_acceptConcurrent(){return v(this,null,(function*(){if(!this._mediaSource||!this._conversation)throw new Ue(F.UNKNOWN_ERROR);this._state="PROCESSING";let e=this._mediaSource.getMediaSettings();this._logWithMediaSettings(Z.ACCEPT_CONCURRENT,e),Gt.debug("Concurrent call",{conversationId:this._conversation.id});try{yield this._signaling.acceptCall(this._mediaSource.getMediaSettings()),jt.onCallAccepted(),this._state="ACTIVE",this._participantState=G.ACCEPTED,this._changeFeatureSet(),this._openTransport(Object.values(this._participants),!0)}catch(e){this._close(e,"Unable to accept concurrent call")}}))}accept(e){return v(this,null,(function*(){if("IDLE"!==this._state)throw De.log(Z.ERROR,"acceptIncoming"),Gt.error("Unable to accept a call - invalid state"),new Error("Unable to accept a call - invalid state");if(!this._mediaSource||!this._conversation)throw new Ue(F.UNKNOWN_ERROR);this._state="PROCESSING",Gt.debug("Accept incoming call",e);try{yield this._mediaSource.request(e);let t=this._mediaSource.getMediaSettings();this._logWithMediaSettings(Z.ACCEPT_INCOMING,t),this._signaling.changeMediaSettings(t),yield this._signaling.acceptCall(t),this._participantState=G.ACCEPTED;let n,r=Object.values(this._participants);Rt.batchParticipantsOnStart&&(n=qe.mapSharedParticipants(r)),jt.onCallAccepted(),jt.onLocalStream(this._mediaSource.getStream(),t),jt.onConversation(this._conversation.externalId,this._conversation.mediaModifiers,this._conversation.muteStates,n),jt.onLocalStatus(Nt.WAITING),this._toggleJoinAvailability(),this._changeNeedRate();let o=Object.values(this._conversation.muteStates);return(o.includes(H.MUTE)||o.includes(H.MUTE_PERMANENT))&&(yield this._processMuteState(Object.keys(this._conversation.muteStates))),this._state="ACTIVE",this._changeFeatureSet(),Rt.batchParticipantsOnStart||this._setParticipantsStatus(r,Nt.WAITING),this._openTransport(r,!0),this._conversation}catch(e){throw this._close(e,"Unable to accept call"),e}}))}decline(){return v(this,null,(function*(){var e;if("IDLE"!==this._state)throw De.log(Z.ERROR,"declineIncoming"),Gt.error("Unable to decline a call - invalid state"),new Error("Unable to decline a call - invalid state");this._state="PROCESSING",Gt.debug("Decline incoming call"),this._logWithMediaSettings(Z.DECLINE_INCOMING,null==(e=this._mediaSource)?void 0:e.getMediaSettings()),this._participantState=G.HUNGUP,this._signaling.ready&&(yield this._signaling.hangup(F.REJECTED)),this._close(new Ue(F.REJECTED))}))}hangup(){return v(this,null,(function*(){Gt.debug("Hangup");let e="ACTIVE"===this._state?F.HUNGUP:F.CANCELED;De.log(Z.HANGUP,e),this._signaling.ready?(yield this._signaling.hangup(e),this._close(new Ue(e))):jt.onHangup(new Ue(F.HUNGUP),this._conversation&&this._conversation.id)}))}addParticipant(e,t){return v(this,null,(function*(){if(!this._signaling.ready)return void this._close(new Ue(F.UNKNOWN_ERROR),"Unable to add participant");let n=yield this._signaling.addParticipant(e,t),r=null;"error"===n.type&&(r="call-unfeasible"===n.error?n.status:F.UNKNOWN_ERROR);let o=n.participant;yield this._onAddParticipant(qe.composeId(o),o,r)}))}removeParticipant(e,t=!1){return v(this,null,(function*(){this._signaling.ready&&(yield this._signaling.removeParticipant(e,t),this._onRemoveParticipant(e))}))}setVolume(e){this._audioOutput.volume=e}updateStatisticsInterval(){this._transport&&this._transport.updateStatisticsInterval()}_openTransport(e,t){var n;if(!this._transport)return;let r=[];for(let n of e)(n.state===G.CALLED||n.state===G.ACCEPTED)&&(this._transport.isAllocated(n.id)||this._transport.allocate(n.id,t)),n.state===G.ACCEPTED&&r.push(n.id);r.length&&this._transport.open(r,null,!!(null==(n=this._conversation)?void 0:n.observer))}_close(e,t){t&&Gt.error(t,e),Gt.debug("Close conversation",e),e.error?this._signaling.ready&&this._signaling.hangup(F.FAILED):De.log(Z.ERROR,e.hangup),Ln._activationMutex=!1;let n=this._conversation&&this._conversation.id;return-1!==[F.CANCELED,F.NOT_FRIENDS,F.CALLEE_IS_OFFLINE,F.CALLER_IS_BLOCKED].indexOf(e.hangup)||e.hangup===F.REJECTED&&!e.remote?(jt.onHangup(e,n),void this.destroy()):(e.hangup!==F.HUNGUP||e.remote&&this._participantState!==G.CALLED)&&(e.hangup!==F.MISSED||e.remote)?e.hangup===F.SOCKET_CLOSED&&Ln._current&&!this._conversation?(this._cleanupSignaling(),void this._cleanupMediaSource()):e.hangup!==F.BUSY||e.remote?(this._state="CLOSE",this._participantState=G.HUNGUP,this._changeFeatureSet(),this._cleanupMediaSource(),this._cleanupParticipants(),this._cleanupParticipantAgnosticStreams(),this._cleanupTransport(),this._cleanupSpeakerDetector(),this._cleanupSpecListener(),this._cleanupSignaling(),this._api.cleanup(),De.destroy(),this._conversation=null,Ln._current=null,Ln._delayedHangup=!1,jt.onHangup(e||new Ue(F.UNKNOWN_ERROR),n),void(null!==this._cooldownQueueCleanupTimer&&(window.clearInterval(this._cooldownQueueCleanupTimer),this._cooldownQueueCleanupTimer=null))):(this._cleanupSignaling(),void this._cleanupMediaSource()):(jt.onHangup(e,n),void this.destroy())}destroy(){let e=this._conversation&&this._conversation.id;Gt.debug("Destroy conversation",{conversationId:e}),this._cleanupMediaSource(),this._cleanupParticipants(),this._cleanupParticipantAgnosticStreams(),this._cleanupTransport(),this._cleanupSpeakerDetector(),this._cleanupSpecListener(),this._cleanupSignaling(),this._api.cleanup(),this._cleanupListeners(),De.destroy(),this._conversation=null,Ln._current=null,Ln._delayedHangup=!1,null!==this._cooldownQueueCleanupTimer&&(window.clearInterval(this._cooldownQueueCleanupTimer),this._cooldownQueueCleanupTimer=null)}_getConversationParams(e){return v(this,null,(function*(){let t=yield this._api.getConversationParams(e);Gt.debug("Api.getConversationParams",t);let n=[],{turn_server:r,stun_server:o}=t;if(o&&n.push(o),r){let e=r.urls.filter(((e,t,n)=>n.indexOf(e)===t));e.push(`${e[e.length-1]}?transport=tcp`),n.push({urls:e,username:r.username,credential:r.credential})}return Rt.iceServers=n,Rt.wssBase=t.endpoint,Rt.wssToken=t.token,t.client_type&&(Rt.clientType=t.client_type),t}))}_startConversation(e,t,n,r,o="",i=!1,a=!1){return v(this,null,(function*(){let s=qe.uuid();Gt.debug("Conversation: start",{conversationId:s,opponentIds:e,opponentType:t,direction:n});let c=r.includes(j.VIDEO),l=yield this._api.startConversation(s,e,t,c,o,i,a);Gt.debug("Api.startConversation",l),yield this._getConversationParams(l.id);let u=yield this._connectSignaling(q.START,l);return yield this._setConversation(l,u,n),u}))}_joinConversation(e){return v(this,null,(function*(){let{conversationId:t,mediaOptions:n,chatId:r,joinLink:o,observedIds:i}=e;Gt.debug("Conversation: join",{conversationId:t,joinLink:o,observedIds:i});let a,s=n.includes(j.VIDEO);if(t)a=yield this._api.joinConversation(t,s,r);else{if(!o)throw new Ue(F.UNKNOWN_ERROR);a=yield this._api.joinConversationByLink(o,s,i)}Gt.debug("Api.joinConversation",a),yield this._getConversationParams(a.id);let c=yield this._connectSignaling(q.JOIN,a);return yield this._setConversation(a,c,b.JOINING),c}))}_prepareConversation(e){return v(this,arguments,(function*(e,t=ce.USER,n){Gt.debug("Conversation: push",{conversationId:e,type:t,peerId:n});let r=this._api.getUserId();if(!r)throw new Ue(F.UNKNOWN_ERROR);let o=(yield this._getConversationParams(e)).device_idx||0,i={id:e,peerId:n,endpoint:`${Rt.wssBase}?userId=${r}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${Rt.wssToken}`,is_concurrent:!1,p2p_forbidden:!1,device_idx:o},a=yield this._connectSignaling(q.ACCEPT,i);return!Ln._current||Ln._current._participantState!==G.ACCEPTED&&Ln._current._participantState!==G.CALLED?(Ln._current&&(Ln._current.destroy(),Ln._current=null),yield this._setConversation(i,a,b.INCOMING,t),a):(Gt.log("Push rejected (busy)"),De.log(Z.PUSH,"busy"),this._signaling.ready&&this._signaling.hangup(F.BUSY),Promise.reject({hangup:F.BUSY}))}))}_createParticipant(e){return v(this,null,(function*(){let t=Object.assign({id:null,externalId:null,mediaSettings:Me(),participantState:{},state:G.CALLED,status:null,remoteStream:null,mediaSource:null,platform:null,clientType:null,roles:[],networkRating:1,lastRequestedLayouts:{},muteStates:{},unmuteOptions:[]},e);if(e.externalId){let n=qe.decomposeParticipantId(t.id).compositeUserId;this._api.cacheExternalId(n,e.externalId)}else t.externalId=yield this._getParticipantId(t.id);return t}))}_getParticipantId(e){return v(this,null,(function*(){try{let t=qe.decomposeParticipantId(e),n=yield this._api.userId(t.compositeUserId);return Object.assign({deviceIdx:t.deviceIdx},n)}catch(e){throw this._close(new Ue(F.NETWORK_ERROR),e),e}}))}_setConversation(e,t,n){return v(this,arguments,(function*(e,t,n,r=ce.USER){let o=t.conversation.participants.map((e=>e.id));yield this._api.prepareUserIds(o);let i=this._api.getUserId(),a=e.device_idx||0;if(!i){let e=(t.conversation.participants||[]).find((e=>qe.comparePeerId(e.peerId,t.peerId)));if(!e)throw new Ue(F.UNKNOWN_ERROR);i=Number(e.id),e.idType&&(r=e.idType),e.deviceIdx&&(a=e.deviceIdx),this._api.setUserId(i)}let s=qe.composeParticipantId(i,r,a),c=yield this._getParticipantId(s);this._conversation={userId:i,compositeUserId:s,externalId:c,acceptTime:t.conversation.acceptTime,features:t.conversation.features||[],id:t.conversation.id||e.id,participantsLimit:t.conversation.participantsLimit||30,topology:t.conversation.topology||An.DIRECT,direction:n,concurrent:t.isConcurrent||e.is_concurrent||!1,needRate:!1,chatId:t.conversation.multichatId,roles:[],recordInfo:null,joinLink:e.join_link,pinnedParticipantId:null,mediaModifiers:t.mediaModifiers,options:[],muteStates:{},unmuteOptions:[],networkRating:1,waitingHall:this._isInWaitingHall(t),observer:!1},this._signaling.setConversationId(e.id),e.p2p_forbidden&&(Rt.forceRelayPolicy=e.p2p_forbidden),De.log(Z.RELAY_POLICY,Rt.forceRelayPolicy?"1":"0"),this._changeFeatureSet(),this._logDevices()}))}_updateConversation(e){if(!this._conversation)throw new Ue(F.UNKNOWN_ERROR);this._conversation.acceptTime=e.conversation.acceptTime,this._conversation.features=e.conversation.features||[],this._conversation.participantsLimit=e.conversation.participantsLimit||30,this._conversation.topology=e.conversation.topology||An.DIRECT,this._conversation.concurrent=e.isConcurrent||!1,this._conversation.chatId=e.conversation.multichatId,this._conversation.mediaModifiers=e.mediaModifiers,this._conversation.waitingHall=!1}_createMediaSource(){let e=new je;return this.subscribe(e,Fe.SOURCE_CHANGED,this._onLocalMediaStreamChanged.bind(this)),this.subscribe(e,Fe.SCREEN_STATUS,this._onScreenSharingStatus.bind(this)),this._audioFix=new en(e),e}_connectSignaling(e,t){return v(this,null,(function*(){return this._signaling.setEndpoint(t.endpoint),this.subscribe(this._signaling,Y.NOTIFICATION,this._onSignalingNotification.bind(this)),this.subscribe(this._signaling,Y.FAILED,this._onSignalingFailed.bind(this)),this.subscribe(this._signaling,Y.RECONNECT,this._onSignalingReconnect.bind(this)),this._signaling.connect(e,t)}))}_registerParticipants(e){return v(this,null,(function*(){if(this._conversation)for(let t of e){let e=qe.composeId(t);e!==this._conversation.compositeUserId?t.state!==G.HUNGUP&&t.state!==G.REJECTED?(this._participants[e]=yield this._createParticipant({id:e,externalId:t.externalId&&Kt.fromSignaling(t.externalId,t.deviceIdx||0),mediaSettings:Me(t.mediaSettings),participantState:qe.mapParticipantState(t),state:t.state,roles:t.roles||[],status:Rt.batchParticipantsOnStart?Nt.WAITING:null,muteStates:t.muteStates||{},unmuteOptions:t.unmuteOptions||[]}),t.roles&&t.roles.length&&(Gt.debug(`Roles for participant [${e}] changed: ${t.roles}`),jt.onRolesChanged(this._participants[e].externalId,t.roles))):this._participants[t.id]&&this._removeParticipant(this._participants[t.id],F.HUNGUP):(this._conversation.roles=t.roles||[],this._conversation.roles.length&&(Gt.debug(`Local roles changed: ${t.roles}`),jt.onLocalRolesChanged(this._conversation.roles)),t.muteStates&&(yield this._onMuteParticipant({muteStates:t.muteStates,unmuteOptions:t.unmuteOptions,mediaOptions:Object.keys(t.muteStates)})))}}))}_processConnectionData(e){qe.isEmptyObject(this._conversation.muteStates)&&e.conversation.muteStates&&this._onMuteParticipant({muteStates:e.conversation.muteStates,unmuteOptions:e.unmuteOptions,mediaOptions:Object.keys(e.conversation.muteStates),muteAll:!0}),e.conversation.pinnedParticipantId&&this._onPinParticipant(e.conversation.pinnedParticipantId),this._onRecordInfo(e.conversation.recordInfo),this._onOptionsChanged(e.conversation.options),e.chatRoom&&e.chatRoom.totalCount&&this._onChatRoomUpdated(D.ATTENDEE,e.chatRoom.totalCount,e.chatRoom.firstParticipants)}_allocateTransport(){if(!this._conversation||!this._mediaSource)return;this._transport=new kn(this._conversation.topology,this._signaling,this._mediaSource,this._serverSettings),this._debugInfo=new tn,this.subscribe(this._transport,Dn.STATE_CHANGED,this._onTransportStateChanged.bind(this)),this.subscribe(this._transport,Dn.LOCAL_STATE_CHANGED,this._onTransportLocalStateChanged.bind(this)),this.subscribe(this._transport,Dn.REMOTE_TRACK_ADDED,this._onRemoteTrackAdded.bind(this)),this.subscribe(this._transport,Dn.REMOTE_TRACK_REMOVED,this._onRemoteTrackRemoved.bind(this)),this.subscribe(this._transport,Dn.REMOTE_ALL_STALL,this._onRemoteAllStall.bind(this)),this.subscribe(this._transport,Dn.REMOTE_DATA_STATS,this._onRemoteDataStats.bind(this)),this.subscribe(this._transport,Dn.SIGNALLED_STALLED_PARTICIPANTS,this._onRemoteSignalledStall.bind(this)),this.subscribe(this._transport,Dn.ACTIVE_PARTICIPANTS_NO_SIGNAL,this._onRemoteActivityNoSignal.bind(this)),this.subscribe(this._transport,Dn.TOPOLOGY_CHANGED,this._onTopologyChanged.bind(this)),this.subscribe(this._transport,Dn.NETWORK_STATUS,this._onNetworkStatus.bind(this)),this.subscribe(this._transport,Dn.REMOTE_STREAM_SECOND,this._onRemoteStreamSecond.bind(this)),this.subscribe(this._transport,Dn.PEER_CONNECTION_CLOSED,this._onPeerConnectionClosed.bind(this));let e=this._conversation.direction===b.OUTGOING&&!this._conversation.concurrent;for(let t of Object.values(this._participants))(t.state===G.ACCEPTED||t.state===G.CALLED)&&this._transport.allocate(t.id,e)}_createSpeakerDetector(){this._transport&&(this._volumesDetector=new On(this._transport),this.subscribe(this._volumesDetector,In.VOLUMES_DETECTED,this._onVolumesDetected.bind(this)),this._speakerDetector=new Rn(this._volumesDetector,this._transport),this.subscribe(this._speakerDetector,xn.SPEAKER_CHANGED,this._onSpeakerChanged.bind(this)),this._localVolumeDetector=new rn(this._mediaSource))}_createSpecListener(){this._transport&&this._volumesDetector&&(this._specListener=new Mn(this._transport,this._volumesDetector,this._participants))}_logDevices(){let e=Et.getCameras().length,t=Et.getMicrophones().length;Gt.debug("Cameras: "+e+(Et.hasCameraPermission()?"✔":"✖")+", Microphones: "+t+(Et.hasMicrophonePermission()?"✔":"✖")),De.log(Z.DEVICES,`${e}_${t}`)}_logWithMediaSettings(e,t){De.log(e,[(null==t?void 0:t.isAudioEnabled)&&"audio",(null==t?void 0:t.isVideoEnabled)&&"video"].filter(Boolean).join("_"))}_removeParticipant(e,t){var n;e.state===G.CALLED||e.state===G.ACCEPTED||"CLOSE"===this._state||!this._participants[e.id]||(t===F.HUNGUP?this._setParticipantsStatus([e],Nt.HANGUP):this._setParticipantsStatus([e],Nt.ERROR,t),null==(n=e.mediaSource)||n.disconnect(),this._conversation&&this._conversation.pinnedParticipantId===e.id&&(this._conversation.pinnedParticipantId=null),this.updateDisplayLayout([{uid:e.externalId,mediaType:qt.CAMERA,stopStream:!0}]),delete this._participants[e.id],jt.onRemoteRemoved(e.externalId))}_cleanupListeners(){this.unsubscribe(),window.removeEventListener("unload",this._onUnload)}_cleanupMediaSource(){this._mediaSource&&(this._mediaSource.destroy(),this._mediaSource=null)}_cleanupParticipants(){Object.values(this._participants).forEach((e=>{var t,n,r;null==(t=e.remoteStream)||t.getTracks().forEach((e=>e.stop())),null==(n=e.secondStream)||n.getTracks().forEach((e=>e.stop())),null==(r=e.mediaSource)||r.disconnect()})),this._participants={},this._audioOutput&&this._audioOutput.destroy()}_cleanupParticipantAgnosticStreams(){Gt.debug("cleaning up participant-agnostic streams"),this._streamByStreamId.forEach((e=>{e.getTracks().forEach((e=>{e.stop()}))})),this._streamByStreamId=new Map,this._streamWaitTimerByStreamDescription.forEach((e=>{window.clearTimeout(e)})),this._streamWaitTimerByStreamDescription=new Map,this._streamIdByStreamDescription=new Map,this._sequenceNumberByStreamDescription=new Map,this._cooldownTimestampByStreamDescription=new Map}_cleanupTransport(){this._transport&&(this._transport.destroy(),this._transport=null),this._debugInfo&&(this._debugInfo=null)}_cleanupSpeakerDetector(){this._speakerDetector&&(this._speakerDetector.destroy(),this._speakerDetector=null),this._volumesDetector&&(this._volumesDetector.destroy(),this._volumesDetector=null),this._localVolumeDetector&&(this._localVolumeDetector.destroy(),this._localVolumeDetector=null)}_cleanupSpecListener(){this._specListener&&(this._specListener.destroy(),this._specListener=null)}_cleanupSignaling(){this._signaling.close(),this._signaling.cleanup()}_onAddParticipant(e,t,n){return v(this,null,(function*(){Gt.debug(`Add new participant [${e}]`);let r=this._participants[e];!r||r.state!==G.ACCEPTED&&r.state!==G.CALLED?(r||(this._participants[e]=yield this._createParticipant({id:e,externalId:t.externalId&&Kt.fromSignaling(t.externalId,t.deviceIdx||0),mediaSettings:Me(t.mediaSettings),state:t.state,roles:t.roles||[],muteStates:t.muteStates||{},unmuteOptions:t.unmuteOptions||[]}),r=this._participants[e]),this._setParticipantsStatus([r],Nt.WAITING),n?(r.state=G.HUNGUP,this._removeParticipant(r,n)):this._transport&&(r.state=G.CALLED,this._transport.allocate(r.id,!0),De.log(Z.ADD_PARTICIPANT),this._invokeRolesChangedCallbackIfNeeded(r))):Gt.warn(`Participant [${r.id}:${r.state}] is already in conversation`)}))}_onRemoveParticipant(e){Gt.debug(`Remove participant [${e}]`);let t=[];for(let n=0;n<=15;n++){let r=qe.compose(e,n),o=this._participants[r];o&&t.push(o)}if(t.length){if(this._transport)for(let e of t)this._transport.close(e.id);De.log(Z.REMOVE_PARTICIPANT)}else Gt.warn(`Participant [${e}] isn't in conversation`)}changeDevice(e){return v(this,null,(function*(){return"audiooutput"===e?this._audioOutput.changeOutput():this._mediaSource?("audioinput"===e&&(this._audioFix=new en(this._mediaSource)),this._mediaSource.changeDevice(e)):Promise.reject(B.UNKNOWN)}))}toggleScreenCapturing(e){return v(this,null,(function*(){return this._mediaSource?this._mediaSource.toggleScreenCapturing(e):Promise.reject(B.UNKNOWN)}))}setVideoStream(e,t=!1){return v(this,null,(function*(){if(this._mediaSource)return this._mediaSource.setVideoStream(e,t)}))}setAudioStream(e){return v(this,null,(function*(){if(this._mediaSource)return this._mediaSource.setAudioStream(e)}))}toggleLocalVideo(e){return v(this,null,(function*(){if(this._mediaSource)return De.log(Z.MEDIA_STATUS,e?"video_1":"video_0"),this._mediaSource.toggleVideo(e)}))}toggleLocalAudio(e){return v(this,null,(function*(){if(this._mediaSource)return De.log(Z.MEDIA_STATUS,e?"audio_1":"audio_0"),this._mediaSource.toggleAudio(e)}))}changePriorities(e){return v(this,null,(function*(){if(e.length<2||!this._signaling.ready)return;let t={},n={};for(let t of e){let e="object"==typeof t.uid?t.uid:Kt.fromId(t.uid);n[Kt.toString(e)]=t.priority}for(let e of Object.values(this._participants)){let r=Kt.toString(e.externalId);n.hasOwnProperty(r)&&(t[e.id]=n[r])}yield this._signaling.changePriorities(t)}))}changeParticipantState(e){return v(this,null,(function*(){for(let[t,n]of Object.entries(e))if(t.length>5||n.length>5)throw new Error("key/value max length is 5 chars, mappings with empty values (null or empty string) are discarded");yield this._signaling.changeParticipantState(e)}))}requestKeyFrame(e){return v(this,null,(function*(){let t={};return t[$t(e)]="kf",this._signaling.updateDisplayLayout(t)}))}updateDisplayLayout(e){return v(this,null,(function*(){if(e.length<1||!this._signaling.ready)return;Gt.log(`Update display layout [${this._signaling.getNextCommandSequenceNumber()}]`,e);let t={};for(let n of e){let e="object"==typeof n.uid?n.uid:Kt.fromId(n.uid),r=this._api.getCachedOkIdByExternalId(e);if(!r){let t=Kt.toString(e);Gt.log(`Unknown participant external ID ${t}`);continue}let o=qe.compose(r,e.deviceIdx),i=$t({participantId:o,mediaType:n.mediaType,streamName:n.streamName}),a=this._participants[o];a&&(a.lastRequestedLayouts[i]=n),Ln._isStopStreaming(n)?this._streamIdByStreamDescription.has(i)&&!this._cooldownTimestampByStreamDescription.has(i)&&this._cooldownTimestampByStreamDescription.set(i,Date.now()):(this._cooldownTimestampByStreamDescription.delete(i),!this._streamIdByStreamDescription.has(i)&&Rt.videoTracksCount>0&&this._streamIdByStreamDescription.set(i,null),t[i]=Ln._layoutToString(n))}let n=this._cooldownTimestampByStreamDescription.keys();for(;this._streamIdByStreamDescription.size>Rt.videoTracksCount;){let e=n.next();if(e.done){Gt.error("Cannot accommodate all streaming requests: tracks available "+Rt.videoTracksCount+"; requested streams: "+Array.from(this._streamIdByStreamDescription.keys()));break}this._stopStreaming(e.value),t[e.value]=Ln._layoutToString({stopStream:!0})}yield this._sendUpdateDisplayLayout(t)}))}_stopStreaming(e){if(this._cooldownTimestampByStreamDescription.delete(e),this._sequenceNumberByStreamDescription.set(e,this._signaling.getNextCommandSequenceNumber()),this._streamWaitTimerByStreamDescription.has(e)&&(Gt.log("Client asked to stop streaming before stream became available",e),window.clearTimeout(this._streamWaitTimerByStreamDescription.get(e)),this._streamWaitTimerByStreamDescription.delete(e)),this._streamIdByStreamDescription.get(e)){let t=Yt(e),n=this._participants[t.participantId];n?(!t.streamName||t.mediaType!==qt.STREAM&&t.mediaType!==qt.SCREEN?jt.onRemoteStream(n.externalId,null):jt.onRemoteLive(n.externalId,t.streamName,null),De.log(Z.PAT_DEALLOCATED)):Gt.log(`Cannot find participant to stop streaming: ${t.participantId}`)}this._streamIdByStreamDescription.delete(e)}_sendUpdateDisplayLayout(e){return v(this,null,(function*(){if(0===Object.keys(e).length)return;let t=yield this._signaling.updateDisplayLayout(e);if(!t)return;let n=[];for(let[e,r]of Object.entries(t.errorCodeByParticipantId||{})){let t=Yt(e),o=this._participants[t.participantId];if(o){let e;"number"!=typeof r?(Gt.warn(`Unexpected error code ${r} received for participant ${t.participantId}`),e=re.UNKNOWN_ERROR):e=1===r?"no-available-tracks":"unknown-error",n.push({externalId:o.externalId,errorReason:e})}}if(n&&n.length)throw new Bn("Could not allocate one or more participants",n)}))}_cleanupCooldownQueue(){let e={},t=this._cooldownTimestampByStreamDescription.entries();for(;;){let n=t.next();if(n.done)break;let r=n.value;if(r[1]+1e4>Date.now())break;let o=r[0];this._stopStreaming(o),e[o]=Ln._layoutToString({stopStream:!0})}this._sendUpdateDisplayLayout(e)}static _isStopStreaming(e){return e.stopStream}static _layoutToString(e){if(Ln._isStopStreaming(e))return"ss";let t="";return void 0!==e.priority&&(t+="p="+e.priority),void 0!==e.width&&void 0!==e.height&&(""!==t&&(t+=":"),t+="sz="+Math.round(e.width)+"x"+Math.round(e.height)),void 0!==e.fit&&(""!==t&&(t+=":"),t+="fit="+e.fit),t}_onParticipantSourcesUpdate(e){if(this._conversation){Gt.log("Received participant sources update notification",e);for(let t of e)this._waitForStreamIfNeeded(t)}}_onParticipantPromoted(e){return v(this,null,(function*(){Gt.log("Promoted in waiting hall",!e.demote),e.demote?(Gt.log("Kicked from waiting hall"),this._close(new Ue(F.REMOVED))):(this._updateConversation(e),yield this._onJoinPart2(e))}))}_onChatRoomUpdated(e){return v(this,arguments,(function*(e,t=0,n=[]){Gt.log(`Chat room updated: ${e}`);let r=[],o=[];n.length&&(n.forEach((e=>{if(e.externalId){let t=Ht.fromSignaling(e.externalId);r.push(t),this._api.cacheExternalId(e.id.id,t)}else o.push(qe.decomposeId(e.id.id).id)})),o.length&&!r.length&&(r=yield this._api.getExternalIdsByOkIds(o))),jt.onChatRoomUpdated(e,t,r)}))}_waitForStreamIfNeeded(e){var t,n;let r=this._matchStreamDescription(e.participantStreamDescription);if(!r||Rt.producerScreenTrack&&r.mediaType===qt.SCREEN)return;let o=$t(r),i=this._sequenceNumberByStreamDescription.get(o);if(i&&i>e.sequenceNumber)return Gt.warn(`Participant ${r.participantId} received outdated PAT response: sequence number ${e.sequenceNumber}; last sent sequence number for given participant is ${i}`),void De.log(Z.PAT_OUTDATED_RESPONSE);let a=e.streamId,s=e.rtpTimestamp?this._getWaitingTime(a,e.rtpTimestamp):0;if(s<=0){this._streamWaitTimerByStreamDescription.delete(o);let i=r.participantId,s=this._participants[i];if(!s)return De.log(Z.PAT_ERROR,"participantMissing"),void Gt.error(`Could not find participant by ID: ${i}`);let c=this._streamByStreamId.get(a);if(!c)return De.log(Z.PAT_ERROR,"streamNotFound"),void Gt.error(`Could not find stream by ID: ${a}`);De.log(Z.PAT_ALLOCATED),this._streamIdByStreamDescription.set(o,a);let l=null==(t=e.participantStreamDescription)?void 0:t.mediaType;if(l===qt.STREAM||l===qt.MOVIE)(null==(n=e.participantStreamDescription)?void 0:n.streamName)&&jt.onRemoteLive(s.externalId,e.participantStreamDescription.streamName,c);else{let e=(Rt.producerScreenTrack?null:s.secondStream)||c;jt.onRemoteStream(s.externalId,e)}}else{Gt.debug(`Waiting for ${s} until stream ${a} for ${o} is switched`);let t=window.setTimeout(this._waitForStreamIfNeeded.bind(this,e),s);this._streamWaitTimerByStreamDescription.set(o,t)}}_matchStreamDescription(e){if(!e)return null;if(this._streamIdByStreamDescription.has($t(e)))return e;let t=e.participantId;if(e.mediaType){let e={participantId:t,mediaType:null};if(this._streamIdByStreamDescription.has($t(e)))return e}else{let e={participantId:t,mediaType:qt.CAMERA};if(this._streamIdByStreamDescription.has($t(e)))return e;let n={participantId:t,mediaType:qt.SCREEN};if(this._streamIdByStreamDescription.has($t(n)))return n}return Gt.error("Received unrequested allocation",e),null}_getWaitingTime(e,t){if(this._transport)return this._transport.getStreamWaitingTimeMs(e,t);throw new Error("transport is not initialized")}_isCallAdmin(){return!!this._conversation&&qe.includesOneOf(this._conversation.roles,[ie.ADMIN,ie.CREATOR])}_checkAdminRole(){if(this._conversation&&!qe.includesOneOf(this._conversation.roles,[ie.ADMIN,ie.CREATOR]))throw new Error("You don't have the required permission")}grantRoles(e,t,n){return v(this,null,(function*(){this._checkAdminRole(),yield this._signaling.grantRoles(e,t,n)}))}muteParticipant(){return v(this,arguments,(function*(e=null,t,n=[]){this._checkAdminRole(),yield this._signaling.muteParticipant(e,t,n)}))}pinParticipant(e,t){return v(this,null,(function*(){this._checkAdminRole(),yield this._signaling.pinParticipant(e,t)}))}updateMediaModifiers(e){return v(this,null,(function*(){this._signaling.ready&&this._conversation&&(this._conversation.mediaModifiers=e,yield this._signaling.updateMediaModifiers(e))}))}changeOptions(e){return v(this,null,(function*(){if(this._signaling.ready&&this._conversation){this._checkAdminRole(),yield this._signaling.changeOptions(e);let t=function(e,t){let n=new Set(e);for(let[e,r]of Object.entries(t))r?n.add(e):n.delete(e);return Array.from(n)}(this._conversation.options,e);this._onOptionsChanged(t)}}))}getWaitingHall(e,t,n){return v(this,null,(function*(){if(!this._signaling)return Promise.reject();let r=null;e&&(r=function(e){try{return JSON.parse(atob(e))}catch(t){Gt.warn("WaitingParticipant: failed convert from string",e,t)}return null}(e));let o=yield this._signaling.getWaitingHall(r,t,n);if(o.error)return Promise.reject(o.message);let i=o.participants||[],a=[],s=[],c=null;return i.length&&(i.forEach((e=>{if(e.externalId){let t=Ht.fromSignaling(e.externalId);a.push(t),this._api.cacheExternalId(e.id.id,t)}else s.push(qe.decomposeId(e.id.id).id)})),s.length&&!a.length&&(a=yield this._api.getExternalIdsByOkIds(s)),o.hasMore&&(c=function(e){try{return btoa(JSON.stringify(e))}catch(t){Gt.warn("WaitingParticipant: failed convert to string",e,t)}return null}(i[i.length-1].id))),{participants:a,pageMarker:c,totalCount:o.totalCount||0}}))}promoteParticipant(e,t){return v(this,null,(function*(){this._signaling&&(yield this._signaling.promoteParticipant(e,t))}))}chatMessage(e,t=null){return v(this,null,(function*(){this._signaling.ready&&(yield this._signaling.chatMessage(e,t))}))}chatHistory(e){return v(this,null,(function*(){if(this._signaling.ready){let t=yield this._signaling.chatHistory(e);for(let e=t.messages.length-1;e>=0;e--){let n=t.messages[e];yield this._onChatMessage(n)}}}))}customData(e,t=null){return v(this,null,(function*(){this._signaling.ready&&(yield this._signaling.customData(e,t))}))}createJoinLink(){return v(this,null,(function*(){if(this._conversation){let e=(yield this._api.createJoinLink(this._conversation.id)).join_link;if(e)return this._conversation.joinLink=e,e}return Promise.reject()}))}removeJoinLink(){return v(this,null,(function*(){if(!this._conversation||!(yield this._api.removeJoinLink(this._conversation.id)).success)return Promise.reject();delete this._conversation.joinLink}))}addMovie(e){return v(this,null,(function*(){var t;let n={movieId:e,participantId:null==(t=this._conversation)?void 0:t.compositeUserId},r=yield this._signaling.addMovie(n);if(r.error)throw new Error(r.error);return{movieId:r.movieId,streamType:r.streamType}}))}updateMovie(e,t,n,r){return v(this,null,(function*(){var o;let i={movieId:e,participantId:null==(o=this._conversation)?void 0:o.compositeUserId};(t||0===t)&&(i.gain=t),n&&(i.offset=n),void 0!==typeof r&&(i.pause=r);let a=yield this._signaling.updateMovie(i);if(a.error)throw new Error(a.error)}))}removeMovie(e){return v(this,null,(function*(){var t;let n={movieId:e,participantId:null==(t=this._conversation)?void 0:t.compositeUserId},r=yield this._signaling.removeMovie(n);if(r.error)throw new Error(r.error)}))}startStream(e=!1,t=null,n=null,r="DIRECT_LINK",o=null){return v(this,null,(function*(){let i={movieId:n,name:t,privacy:r,groupId:o,streamMovie:!e},a=yield this._signaling.startStream(i);return a.error?Promise.reject(a.message):a}))}stopStream(){return v(this,null,(function*(){let e=yield this._signaling.stopStream();return e.error?Promise.reject():e}))}recordSetRole(e,t){return v(this,null,(function*(){let n=yield this._signaling.recordSetRole(e,t);if(n.error)throw new Error(n.error)}))}getStreamInfo(){return v(this,null,(function*(){let e=yield this._signaling.getRecordStatus();return{movieId:e.recordMovieId,preview:e.recordMoviePreviewUrl}}))}setLocalResolution(e,t,n){return v(this,null,(function*(){var r;if(e<Rt.videoMinWidth||t<Rt.videoMinHeight)throw new Error("Sizes received are less than the `videoMinWidth` or `videoMinHeight`");if(null==n?void 0:n.effect){if(n.effect.width<Rt.videoMinWidth||n.effect.height<Rt.videoMinHeight)throw new Error("Sizes of effect received are less than the `videoMinWidth` or `videoMinHeight`");Rt.videoEffectMaxHeight=n.effect.height,Rt.videoEffectMaxWidth=n.effect.width}return Rt.videoMaxWidth=e,Rt.videoMaxHeight=t,null==(r=this._mediaSource)?void 0:r.setResolution(e,t)}))}videoEffect(e){return v(this,null,(function*(){var t;return null==(t=this._mediaSource)?void 0:t.videoEffect(e)}))}_onLocalMediaStreamChanged(e){return v(this,null,(function*(){var t,n;!this._conversation||(Gt.debug("Local media stream changed",e.mediaSettings),jt.onLocalStreamUpdate(e.mediaSettings,e.kind),this._signaling.ready&&!(null==(t=this._conversation)?void 0:t.waitingHall)&&!(null==(n=this._conversation)?void 0:n.observer)&&(yield this._signaling.changeMediaSettings(e.mediaSettings)))}))}_onScreenSharingStatus(e){return v(this,null,(function*(){var t,n;if(Gt.log("Screen sharing changed",e.track,e.mediaSettings),Rt.consumerScreenTrack){let r=e.track?new MediaStream([e.track]):null;jt.onScreenStream(r,e.mediaSettings),this._signaling.ready&&!(null==(t=this._conversation)?void 0:t.waitingHall)&&!(null==(n=this._conversation)?void 0:n.observer)&&(yield this._signaling.changeMediaSettings(e.mediaSettings))}}))}_changeRemoteMediaSettings(e,t){Gt.debug(`Remote media settings changed [${e}]`,t);let n=this._participants[e];!n||(n.mediaSettings=t,"ACTIVE"===this._state&&jt.onRemoteMediaSettings(n.externalId,t),this._specListener&&this._specListener.onChangeRemoteMediaSettings(e,t))}_changeRemoteParticipantState(e,t){Gt.debug(`Remote participant state changed [${e}]`,t);let n=this._participants[e];!n||(n.participantState=t||{},"ACTIVE"===this._state&&(Rt.participantStateMapped?jt.onRemoteParticipantState(n.externalId,n.participantState):jt.onRemoteParticipantState(n.externalId,qe.mapLegacyParticipantState(n.participantState))))}_invokeRolesChangedCallbackIfNeeded(e){"ACTIVE"===this._state&&e.roles&&e.roles.length&&(Gt.debug(`Roles for participant [${e.id}] changed: ${e.roles}`),jt.onRolesChanged(e.externalId,e.roles))}_onSignalingNotification(e){switch(e.notification){case X.ACCEPTED_CALL:return this._onAcceptedCall(e);case X.HUNGUP:return this._onHungup(e);case X.PARTICIPANT_ADDED:return this._onAddedParticipant(e);case X.PARTICIPANT_JOINED:return this._onJoinedParticipant(e);case X.CLOSED_CONVERSATION:return this._onClosedConversation(e);case X.MEDIA_SETTINGS_CHANGED:return this._onMediaSettingsChanged(e);case X.PARTICIPANT_STATE_CHANGED:return this._onParticipantStateChanged(e);case X.RATE_CALL_DATA:return this._onNeedRate();case X.FEATURE_SET_CHANGED:return this._onFeatureSetChanged(e);case X.MULTIPARTY_CHAT_CREATED:return this._onMultipartyChatCreated(e);case X.FORCE_MEDIA_SETTINGS_CHANGE:return this._onForceMediaSettingsChange(e);case X.SETTINGS_UPDATE:return this._onSettingsUpdate(e);case X.VIDEO_QUALITY_UPDATE:return this._onVideoQualityUpdate(e);case X.REGISTERED_PEER:return this._onPeerRegistered(e);case X.SWITCH_MICRO:return this._onMicSwitched(e);case X.CHAT_MESSAGE:return this._onChatMessage(e);case X.CUSTOM_DATA:return this._onCustomData(e);case X.RECORD_STARTED:return this._onRecordInfo(e.recordInfo);case X.RECORD_STOPPED:return this._onRecordInfo(null);case X.ROLES_CHANGED:return this._onRolesChanged(e.participantId,e.roles||[]);case X.MUTE_PARTICIPANT:return this._onMuteParticipant(e);case X.PIN_PARTICIPANT:return this._onPinParticipant(e.participantId,e.unpin);case X.OPTIONS_CHANGED:return this._onOptionsChanged(e.options||[]);case X.PARTICIPANT_SOURCES_UPDATE:return this._onParticipantSourcesUpdate(e.participantUpdateInfos);case X.PROMOTE_PARTICIPANT:return this._onParticipantPromoted(e);case X.CHAT_ROOM_UPDATED:return this._onChatRoomUpdated(e.eventType,e.totalCount,e.firstParticipants)}}_onSignalingReconnect(e){return v(this,null,(function*(){if(!this._conversation)return;e.conversation.acceptTime&&(this._conversation.acceptTime=e.conversation.acceptTime),e.conversation.participantsLimit&&(this._conversation.participantsLimit=e.conversation.participantsLimit),e.conversation.features&&(this._conversation.features=e.conversation.features,this._changeFeatureSet()),e.conversation.pinnedParticipantId!==this._conversation.pinnedParticipantId&&(e.conversation.pinnedParticipantId?this._onPinParticipant(e.conversation.pinnedParticipantId,!1):this._conversation.pinnedParticipantId&&this._onPinParticipant(this._conversation.pinnedParticipantId,!0)),e.conversation.state;let t=null;if(e.conversation.participants){let n=Object.keys(this._participants),r=[];for(let n of e.conversation.participants){let e=qe.composeId(n),o=n.roles||[];if(e===this._conversation.compositeUserId){t=Me(n.mediaSettings),ae(this._conversation.roles,o)||this._onRolesChanged(e,o);continue}r.push(e);let i=this._participants[e];if(i){let t=Me(n.mediaSettings);Re(t,i.mediaSettings)||this._changeRemoteMediaSettings(e,t);let r=qe.mapParticipantState(n),a=i.participantState;qe.isEqualParticipantState(r,a)||this._changeRemoteParticipantState(e,r),ae(o,i.roles)||this._onRolesChanged(i.id,o)}else yield this._onJoinedParticipant({participantId:n.id,participant:n,mediaSettings:n.mediaSettings})}for(let e of n)r.indexOf(e)<0&&this._removeParticipant(this._participants[e],F.HUNGUP)}this._onMuteParticipant({muteStates:e.conversation.muteStates,unmuteOptions:e.unmuteOptions,mediaOptions:[]},t),this._onRecordInfo(e.conversation.recordInfo),this._onOptionsChanged(e.conversation.options)}))}_onSignalingFailed(e){Gt.error("Signaling failed",e),this._close(e)}_onAcceptedCall(e){return v(this,null,(function*(){let t=qe.composeMessageId(e),n=qe.getPeerIdString(e.peerId);if(Gt.debug(`Participant accepted call [${t}]`),this._conversation&&t===this._conversation.compositeUserId)return void this._close(new Ue(F.MISSED),"Call accepted on other device");let r=this._participants[t];r||(this._participants[t]=yield this._createParticipant({id:t,mediaSettings:Me(e.mediaSettings)}),r=this._participants[t]),r.state=G.ACCEPTED,r.mediaSettings=Me(e.mediaSettings),this._logWithMediaSettings(Z.ACCEPTED_OUTGOING,r.mediaSettings),this._conversation&&this._conversation.direction===b.OUTGOING&&("IDLE"===this._state||"PROCESSING"===this._state)&&(this._state="ACTIVE",this._changeFeatureSet()),"ACTIVE"===this._state&&this._transport&&this._transport.open([r.id],n),this._changeRemoteMediaSettings(t,r.mediaSettings),this._changeRemoteParticipantState(t)}))}_onHungup(e){Gt.debug(`Participant hungup [${e.participantId}]`,{reason:e.reason});let t=qe.composeMessageId(e);if(this._conversation&&this._conversation.compositeUserId===t)return void this._close(new Ue(e.reason));let n=this._participants[t];n?(this._transport&&this._transport.close(t),n.state=e.reason===F.REJECTED?G.REJECTED:G.HUNGUP,"CLOSE"!==this._state&&this._removeParticipant(n,F.HUNGUP)):Gt.warn(`Participant [${t}] isn't in conversation`)}_onAddedParticipant(e){return v(this,null,(function*(){var t,n;Gt.debug(`Participant added [${e.participantId}]`);let r=qe.composeMessageId(e),o=this._participants[r];o&&o.state!==G.HUNGUP&&o.state!==G.REJECTED?Gt.debug(`Participant [${r}] is already in conversation and is active`):(o||(this._participants[r]=yield this._createParticipant({id:r,externalId:e.participant.externalId&&Kt.fromSignaling(e.participant.externalId,e.participant.deviceIdx||0),mediaSettings:Me(e.participant.mediaSettings),state:e.participant.state,participantState:qe.mapParticipantState(e.participant),roles:e.participant.roles||[],muteStates:e.participant.muteStates||{},unmuteOptions:e.participant.unmuteOptions||[]}),o=this._participants[r]),o.state=G.CALLED,o.mediaSettings=Me(null==(t=e.participant)?void 0:t.mediaSettings),o.participantState=qe.mapParticipantState(e.participant),o.roles=(null==(n=e.participant)?void 0:n.roles)||[],this._setParticipantsStatus([o],Nt.WAITING),"ACTIVE"===this._state&&this._transport&&this._transport.allocate(o.id,!0),this._changeRemoteMediaSettings(r,o.mediaSettings),this._changeRemoteParticipantState(r,o.participantState),this._invokeRolesChangedCallbackIfNeeded(o))}))}_onJoinedParticipant(e){return v(this,null,(function*(){var t,n;Gt.debug(`Participant joined [${e.participantId}]`);let r=qe.composeMessageId(e),o=this._participants[r];o&&o.state===G.ACCEPTED?Gt.warn(`Participant [${r}] is already in conversation and is active`):(o||(this._participants[r]=yield this._createParticipant({id:r,externalId:e.participant.externalId&&Kt.fromSignaling(e.participant.externalId,e.participant.deviceIdx||0),mediaSettings:Me(e.participant.mediaSettings),state:e.participant.state,participantState:qe.mapParticipantState(e.participant),roles:e.participant.roles||[],muteStates:e.participant.muteStates||{},unmuteOptions:e.participant.unmuteOptions||[]}),o=this._participants[r]),this._conversation&&this._conversation.direction===b.OUTGOING&&("IDLE"===this._state||"PROCESSING"===this._state)&&(this._state="ACTIVE",this._changeFeatureSet()),o.state=G.ACCEPTED,o.mediaSettings=Me(e.mediaSettings),o.participantState=qe.mapParticipantState(e.participant),o.roles=e.participant.roles||[],(null==(t=this._transport)?void 0:t.isAllocated(o.id))?this._setParticipantsStatus([o],Nt.CONNECTED):this._setParticipantsStatus([o],Nt.WAITING),"ACTIVE"===this._state&&this._transport&&(this._transport.isAllocated(o.id)||this._transport.allocate(o.id,!0),this._transport.open([o.id],null,!!(null==(n=this._conversation)?void 0:n.observer))),this._changeRemoteMediaSettings(r,o.mediaSettings),this._changeRemoteParticipantState(r,o.participantState),this._invokeRolesChangedCallbackIfNeeded(o))}))}_onClosedConversation(e){this._toggleJoinAvailability(),this._close(new Ue(e.reason,{remote:!0}))}_onMediaSettingsChanged(e){let t=qe.composeMessageId(e);this._changeRemoteMediaSettings(t,Me(e.mediaSettings))}_onParticipantStateChanged(e){let t=qe.composeMessageId(e);this._changeRemoteParticipantState(t,qe.mapParticipantState(e))}_onNeedRate(){this._conversation&&(this._conversation.needRate=!0,this._changeNeedRate())}_onFeatureSetChanged(e){this._conversation&&(this._conversation.features=e.features,this._changeFeatureSet())}_onMultipartyChatCreated(e){this._conversation&&(this._conversation.chatId=e.chatId,this._toggleJoinAvailability(),jt.onMultipartyChatCreated(this._conversation))}_onForceMediaSettingsChange(e){return v(this,null,(function*(){if(!this._mediaSource)return;let t=this._mediaSource.getMediaSettings(),n=Me(e.mediaSettings);t.isAudioEnabled!==n.isAudioEnabled&&(yield this._mediaSource.toggleAudio(n.isAudioEnabled)),t.isVideoEnabled!==n.isVideoEnabled&&(yield this._mediaSource.toggleVideo(n.isVideoEnabled)),Rt.consumerScreenTrack&&t.isScreenSharingEnabled!==n.isScreenSharingEnabled&&(yield this._mediaSource.toggleScreenCapturing(n.isScreenSharingEnabled))}))}_onSettingsUpdate(e){let t={camera:e.camera,screenSharing:e.screenSharing};this._serverSettings=Zt(this._serverSettings,t),this._transport&&this._transport.updateSettings(this._serverSettings)}_onVideoQualityUpdate(e){let t=Math.round(e.quality.maxBitrate/1024),n=e.quality.maxDimension,r={camera:Object.assign({},this._serverSettings.camera,{maxBitrateK:t,maxDimension:n}),screenSharing:null};this._serverSettings=Zt(this._serverSettings,r),Gt.log("Got video quality update notification",this._serverSettings),this._transport&&this._transport.updateSettings(this._serverSettings)}_onPeerRegistered(e){let t=qe.composeMessageId(e);this._participants[t]&&(this._participants[t].clientType=e.clientType,this._participants[t].platform=e.platform)}_onMicSwitched(e){return v(this,null,(function*(){jt.onDeviceSwitched(j.AUDIO,!e.mute),yield this.toggleLocalAudio(!e.mute)}))}_onChatMessage(e){return v(this,null,(function*(){let t,n=qe.composeMessageId(e);t=this._participants[n]?this._participants[n].externalId:yield this._getParticipantId(n),jt.onChatMessage(e.message,t,e.direct)}))}_onCustomData(e){return v(this,null,(function*(){if(e.data.hasOwnProperty("sdk"))return;let t,n=qe.composeMessageId(e);t=this._participants[n]?this._participants[n].externalId:yield this._getParticipantId(n),jt.onCustomData(e.data,t,e.direct)}))}_onRecordInfo(e){return v(this,null,(function*(){if(!this._conversation)return;let t=!1;if(!this._conversation.recordInfo!=!e?t=!0:this._conversation.recordInfo&&e&&(t=this._conversation.recordInfo.recordMovieId!==e.recordMovieId),t)if(e){let t=yield this._getParticipantId(e.initiator);jt.onRecordStarted(t,e.recordMovieId,e.recordStartTime,e.recordType,e.recordExternalMovieId,e.recordExternalOwnerId)}else jt.onRecordStopped();this._conversation.recordInfo=e}))}_onRolesChanged(e,t){if(this._conversation&&e===this._conversation.compositeUserId&&!ae(this._conversation.roles,t))return Gt.debug(`Local roles changed: ${t}`),this._conversation.roles=t,jt.onLocalRolesChanged(t),void this._processMuteState(Object.keys(this._conversation.muteStates));let n=this._participants[e];n&&!ae(n.roles,t)&&(Gt.debug(`Roles for participant [${e}] changed: ${t}`),n.roles=t,jt.onRolesChanged(n.externalId,t))}_onMuteParticipant(e,t=null){return v(this,null,(function*(){if(!this._conversation)return;let n=e.muteStates||{},r=e.unmuteOptions||[],o=e.mediaOptions||[],i=e.adminId?this._participants[e.adminId]:null;if(e.participantId&&e.participantId!==this._conversation.compositeUserId){if(!this._isCallAdmin())return void Gt.warn(`Not admin got mute states for participant [${e.participantId}]`);let t=this._participants[e.participantId];t&&(Gt.debug(`Mute states for participant [${e.participantId}] changed`,n),jt.onMuteStates(n,r,o,e.muteAll,e.unmute,t.externalId,null==i?void 0:i.externalId))}else qe.isObjectsEquals(this._conversation.muteStates,n)&&qe.isArraysEquals(this._conversation.unmuteOptions,r)&&!o.length||(this._conversation.muteStates=n,this._conversation.unmuteOptions=r,e.adminId!==this._conversation.compositeUserId&&(yield this._processMuteState(o,e.muteAll,e.unmute,t,i)))}))}_processMuteState(){return v(this,arguments,(function*(e=[],t=!1,n=!1,r=null,o=null){if(!this._conversation||!this._mediaSource||this._participantState!==G.ACCEPTED)return;let i=Object.assign({},this._conversation.muteStates),a=this._conversation.unmuteOptions,s=this._mediaSource.getMediaSettings(),c=Object.entries(i);for(let[t,o]of c)if((o===H.MUTE||o===H.MUTE_PERMANENT)&&(this._isCallAdmin()&&o===H.MUTE_PERMANENT&&(i[t]=H.MUTE),e.includes(t)&&!n))switch(t){case j.VIDEO:s.isVideoEnabled&&!(null==r?void 0:r.isVideoEnabled)&&(jt.onDeviceSwitched(j.VIDEO,!1),yield this.toggleLocalVideo(!1));break;case j.AUDIO:s.isAudioEnabled&&!(null==r?void 0:r.isAudioEnabled)&&(jt.onDeviceSwitched(j.AUDIO,!1),yield this.toggleLocalAudio(!1));break;case j.SCREEN_SHARING:s.isScreenSharingEnabled&&!(null==r?void 0:r.isScreenSharingEnabled)&&(jt.onDeviceSwitched(j.SCREEN_SHARING,!1),yield this.toggleScreenCapturing(!1))}jt.onMuteStates(i,a,e,t,n,null,null==o?void 0:o.externalId)}))}_onPinParticipant(e,t=!1){if(!this._conversation)return;let n=this._conversation.pinnedParticipantId;n&&n!==e&&(this._participants[n]?jt.onPinnedParticipant(this._participants[n].externalId,!0):this._conversation.compositeUserId===n&&jt.onLocalPin(!0)),this._participants[e]?jt.onPinnedParticipant(this._participants[e].externalId,t):this._conversation.compositeUserId===e&&jt.onLocalPin(t),this._conversation.pinnedParticipantId=t?null:e}_onOptionsChanged(e){this._conversation&&!function(e,t){if(e.length!==t.length)return!1;for(let n of e)if(!t.includes(n))return!1;return!0}(this._conversation.options,e)&&(this._conversation.options=e,jt.onOptionsChanged(e))}_onNetworkStatus(e){if(this._conversation){let t=[];for(let[n,r]of Object.entries(e)){let e;if(n===this._conversation.compositeUserId||""===n)e=this._conversation.networkRating;else{if(!this._participants[n])continue;e=this._participants[n].networkRating}if(e!==r)if(n===this._conversation.compositeUserId||""===n)this._conversation.networkRating=r,jt.onLocalNetworkStatusChanged(r);else{let e=this._participants[n];e.networkRating=r,t.push({uid:e.externalId,rating:r})}}if(0===t.length)return;Gt.log("Received network status update: ",e),jt.onNetworkStatusChanged(t)}}_onRemoteStreamSecond(e,t){let n=this._participants[e];if(n){if(Rt.producerScreenTrack)return void jt.onRemoteScreenStream(n.externalId,t);if(n.secondStream=t,Rt.videoTracksCount>0){let t=e;if(!this._streamIdByStreamDescription.has(t))return void Gt.error("Received remote stream notification for a participant that has no track associated with it",t);let r=this._streamIdByStreamDescription.get(t);if(!r||this._streamWaitTimerByStreamDescription.has(t))return void Gt.log("Delaying secondary stream start/stop until main stream becomes available",t);let o=this._streamByStreamId.get(r);if(!o)return De.log(Z.PAT_ERROR,"streamNotFound"),void Gt.error(`Could not find stream by ID: ${r}`);jt.onRemoteStream(n.externalId,n.secondStream||o)}else{let e=t||n.remoteStream;e&&jt.onRemoteStream(n.externalId,e)}}}_onPeerConnectionClosed(e){e===An.SERVER&&this._cleanupParticipantAgnosticStreams()}_changeFeatureSet(){if(this._conversation){let e="ACTIVE"===this._state,t=this._conversation.features.includes(A.ADD_PARTICIPANT);jt.onCallState(e,t,this._conversation)}}_changeNeedRate(){this._conversation&&this._conversation.needRate&&jt.onRateNeeded()}_onVolumesDetected(e){let t=[];for(let[n,r]of Object.entries(e)){let e=this._participants[n];e&&e.externalId&&t.push({uid:e.externalId,volume:r.real})}jt.onVolumesDetected(t)}_onSpeakerChanged(e){this._activeSpeakerId=e,this._participants[e]&&this._lastSignalledActiveSpeakerId!==e&&(jt.onSpeakerChanged(this._participants[e].externalId),this._lastSignalledActiveSpeakerId=e)}_onTransportStateChanged(e,t){return v(this,null,(function*(){let n;if(Gt.debug(`Transport state has changed: ${t}`,e),t===Pn.CONNECTED?n=Nt.CONNECTED:t===Pn.CONNECTING||t===Pn.OPENED?n=Nt.CONNECTING:t===Pn.RECONNECTING&&(n=Nt.RECONNECT),!n)return;let r=e.reduce(((e,n)=>{if(n in this._participants){let r=this._participants[n];e.push(r),t===Pn.CONNECTED&&(r.remoteStream||(r.mediaSettings&&this._changeRemoteMediaSettings(n,r.mediaSettings),this._changeRemoteParticipantState(n,r.participantState)),this._updateDisplayLayoutFromCache(n))}else Gt.warn(`Participant [${n}] isn't in conversation`);return e}),[]);!r.length||this._setParticipantsStatus(r,n)}))}_onTransportLocalStateChanged(e){return v(this,null,(function*(){Gt.debug(`Local transport state has changed: ${e}`),e===Pn.CONNECTED&&jt.onLocalStatus(Nt.CONNECTED),e===Pn.CONNECTING&&jt.onLocalStatus(Nt.CONNECTING),e===Pn.RECONNECTING&&jt.onLocalStatus(Nt.RECONNECT),e===Pn.FAILED&&this._transport&&0===this._transport.allocated().length&&(this._signaling.ready&&(yield this._signaling.hangup(F.FAILED)),this._close(new Ue(F.FAILED),"Transport failed"))}))}_onRemoteTrackAdded(e,t,n){return v(this,null,(function*(){if(e.endsWith(te.AUDIO_MIX))Gt.debug("Remote audio mix track added"),this._audioOutput.add(n);else if(e.startsWith(te.PARTICIPANT_AGNOSTIC_TRACK_PREFIX))Gt.debug(`Participant-agnostic track added: ${e}`),this._streamByStreamId.set(e,t);else{Gt.debug(`Remote track added on the participant [${e}]`,{kind:n.kind});let r=this._participants[e];if(r||(Gt.warn(`Conversation: track added before participant [${e}]`),this._participants[e]=yield this._createParticipant({id:e}),r=this._participants[e],this._setParticipantsStatus([r],Nt.WAITING),this._activeSpeakerId===e&&this._lastSignalledActiveSpeakerId!==e&&(jt.onSpeakerChanged(r.externalId),this._lastSignalledActiveSpeakerId=e)),this._transport&&!this._transport.isAllocated(r.id)&&this._transport.allocate(r.id,!1),n.kind===We.audio&&this._audioOutput.add(n),r.remoteStream!==t){if(r.remoteStream=t,r.secondStream)return;jt.onRemoteStream(r.externalId,t)}r.mediaSettings&&this._changeRemoteMediaSettings(e,r.mediaSettings),Rt.batchParticipantsOnStart||this._changeRemoteParticipantState(e,r.participantState)}}))}_onRemoteTrackRemoved(e,t,n){switch(Gt.debug(`[${e}] remote track (removed)`,{track:n}),n.kind){case We.audio:this._removeAudioTrack(e,t,n);break;case We.video:case We.screen:this._removeVideoTrack(e,t,n)}}_removeAudioTrack(e,t,n){if(e!==te.AUDIO_MIX){let n=this._participants[e];if(!n||n.remoteStream&&n.remoteStream!==t)return}this._audioOutput.remove(n)}_removeVideoTrack(e,t,n){}_onRemoteActivityNoSignal(){this._onRemoteSignalledStall([]),this._onRemoteAllStall(!1)}_onTopologyChanged(e){this._conversation&&(this._conversation.topology=e,this._changeFeatureSet())}_onRemoteAllStall(e){if(this._remoteAllStalled===e)return;this._remoteAllStalled=e;let t=[],n=[];for(let r in this._participants)if(this._participants.hasOwnProperty(r)){let o=this._participants[r];e||this._lastStalled[r]?t.push(o):n.push(o)}t.length&&this._setParticipantsStatus(t,Nt.RECONNECT),n.length&&this._setParticipantsStatus(n,Nt.CONNECTED)}_onRemoteSignalledStall(e){let t={},n=[],r=[];e.forEach((e=>{if(t[e]=!0,!this._lastStalled[e]){let t=this._participants[e];t&&!this._remoteAllStalled&&n.push(t)}delete this._lastStalled[e]})),Object.keys(this._lastStalled).forEach((e=>{let t=this._participants[e];t&&!this._remoteAllStalled&&r.push(t)})),n.length&&this._setParticipantsStatus(n,Nt.RECONNECT),r.length&&this._setParticipantsStatus(r,Nt.CONNECTED),this._lastStalled=t}_onRemoteDataStats(e){this._debugInfo&&this._debugInfo.onRemoteDataStats(e,this._participants),this._fixAudioDevice(e.outbound.rtps)}_fixAudioDevice(e){var t;!Et.hasMicrophone()||!this._audioFix||!(null==(t=this._mediaSource)?void 0:t.getMediaSettings().isAudioEnabled)||this._audioFix.fix(e)}_toggleJoinAvailability(){let e=this._conversation&&this._conversation.chatId,t=e&&"CLOSE"!==this._state||!1;e&&(Gt.debug("Toggle join availability",{available:t,chatId:e}),jt.onJoinStatus(t,e))}_updateDisplayLayoutFromCache(e){return v(this,null,(function*(){var t;if((null==(t=this._transport)?void 0:t.getTopology())!==An.SERVER)return;let n=this._participants[e];n&&n.lastRequestedLayouts&&Object.keys(n.lastRequestedLayouts).length&&(yield this.updateDisplayLayout(Object.values(n.lastRequestedLayouts)))}))}_setParticipantsStatus(e,t,n=null){if(!e.length)return;let r=e.reduce(((e,r)=>(r.status!==t&&(r.status=t,Rt.batchParticipantsOnStart?e.push(r.externalId):jt.onParticipantStatus(r.externalId,t,n)),e)),[]);!r.length||Rt.batchParticipantsOnStart&&jt.onRemoteStatus(r,t,n)}},Nn=Ln;Nn._delayedHangup=!1;var Bn=class extends Error{constructor(e,t){super(e),Object.setPrototypeOf(this,Bn.prototype),this.participantErrors=t}};var Un,Fn=((Un=Fn||{}).RECOVER="recover",Un.ACCEPT_CALL="accept-call",Un.ADD_PARTICIPANT="add-participant",Un.REMOVE_PARTICIPANT="remove-participant",Un.HANGUP="hangup",Un.TRANSMIT_DATA="transmit-data",Un.ACCEPT_PRODUCER="accept-producer",Un.ALLOCATE_CONSUMER="allocate-consumer",Un.CHANGE_MEDIA_SETTINGS="change-media-settings",Un.CHANGE_PARTICIPANT_STATE="change-participant-state",Un.CHANGE_STREAM_PRIORITIES="change-streams-priorities",Un.UPDATE_DISPLAY_LAYOUT="update-display-layout",Un.REPORT_PERF_STAT="report-perf-stat",Un.RECORD_START="record-start",Un.RECORD_STOP="record-stop",Un.RECORD_SET_ROLE="record-set-role",Un.RECORD_GET_STATUS="record-get-status",Un.SWITCH_MICRO="switch-micro",Un.SWITCH_TOPOLOGY="switch-topology",Un.REQUEST_REALLOC="request-realloc",Un.CHAT_MESSAGE="chat-message",Un.CHAT_HISTORY="chat-history",Un.CUSTOM_DATA="custom-data",Un.GRANT_ROLES="grant-roles",Un.MUTE_PARTICIPANT="mute-participant",Un.PIN_PARTICIPANT="pin-participant",Un.UPDATE_MEDIA_MODIFIERS="update-media-modifiers",Un.CHANGE_OPTIONS="change-options",Un.GET_WAITING_HALL="get-waiting-hall",Un.PROMOTE_PARTICIPANT="promote-participant",Un.REQUEST_TEST_MODE="request-test-mode",Un.ADD_MOVIE="add-movie",Un.UPDATE_MOVIE="update-movie",Un.REMOVE_MOVIE="remove-movie",Un),Wn=Fn,jn="open",Vn=[()=>Rt.producerScreenTrack,()=>Rt.videoTracksCount>0,()=>!0,()=>Rt.filteredMessages,()=>Rt.consumerScreenTrack,()=>!0,()=>Rt.movieShare],Hn=class extends E{constructor(){super(...arguments),this.socket=null,this.sequence=1,this.lastStamp=0,this.websocketCommandsQueue=[],this.datachannelCommandsQueue=[],this.incomingCache=[],this.responseHandlers={},this.reconnectCount=0,this.conversationResolve=null,this.conversationReject=null,this.connected=!1,this.listenersReady=!1,this.postfix="&platform="+Rt.platform+"&appVersion="+Rt.appVersion+"&version="+Rt.protocolVersion+"&device="+Rt.device+"&capabilities="+Hn._getCapabilityFlags(),this.peerId=null,this.conversationId=null,this.reconnectTimer=0,this.connectionMessageWaitTimer=0,this.doctorTimer=0,this.participantIdRegistry=null,this.producerNotificationDataChannel=null,this.producerCommandDataChannel=null}static _getCapabilityFlags(){let e=0;for(let t=0;t<Vn.length;t++)Vn[t]()&&(e|=1<<t);return e.toString(16).toUpperCase()}get ready(){return null!==this.socket}setEndpoint(e){this.endpoint=e}setConversationId(e){this.conversationId=e}setParticipantIdRegistry(e){this.participantIdRegistry=e}setProducerNotificationDataChannel(e){this.producerNotificationDataChannel=e,this.producerNotificationDataChannel.onmessage=e=>{var t;let n=null==(t=this.participantIdRegistry)?void 0:t.handleMessage(e.data);n&&this._handleMessage(n)}}setProducerCommandDataChannel(e){this.producerCommandDataChannel=e,this.producerCommandDataChannel.onmessage=this._onMessage.bind(this),this._handleCommandsQueue(this.datachannelCommandsQueue)}cleanup(){this.datachannelCommandsQueue=[]}connect(e){return v(this,null,(function*(){return this.postfix+=`&clientType=${Rt.clientType}`,new Promise(((t,n)=>{if(this.socket&&this.socket.readyState<WebSocket.CLOSING)return De.log(Z.SOCKET_ACTION,"already_opened"),void n(Error("Socket already opened"));this.conversationResolve=e=>{t(e),this.conversationResolve=null,this.conversationReject=null},this.conversationReject=e=>{n(e),this.conversationResolve=null,this.conversationReject=null},this._connect(e)}))}))}_send(e){return v(this,arguments,(function*(e,t={},n=0){if(t.participantId){let e=qe.decomposeParticipantId(t.participantId),n=qe.decomposeId(e.compositeUserId);t=Object.assign({},t,{participantId:n.id,participantType:n.type}),e.deviceIdx&&(t.deviceIdx=e.deviceIdx)}return this._sendRaw(e,t,n)}))}_sendRaw(e){return v(this,arguments,(function*(e,t={},n=0){let r=t=>{var n;if(this._isDataChannelCommand(e))this.datachannelCommandsQueue.push(t),(null==(n=this.producerCommandDataChannel)?void 0:n.readyState)===jn&&this._handleCommandsQueue(this.datachannelCommandsQueue);else{if(!this.socket)return De.log(Z.SOCKET_ACTION,"not_opened"),Gt.warn("Socket not opened"),void t.reject(new Error(`Socket not opened [${e}]`),!0);this.socket.readyState>WebSocket.OPEN&&(De.log(Z.SOCKET_ACTION,"invalid_state"),Gt.warn(`Socket is not opened, state ${this.socket.readyState}`)),this.websocketCommandsQueue.push(t),this.socket&&this.socket.readyState===WebSocket.OPEN&&this._handleCommandsQueue(this.websocketCommandsQueue)}};return new Promise(((o,i)=>{let a={sequence:this.sequence++,name:e,params:t,responseTimer:0,resolve:o,reject:(t,o=!1)=>{!n||o?i(t):(Gt.debug("Resending a signaling message",e,a.sequence),n--,r(a))}};r(a)}))}))}_isDataChannelCommand(e){return!!this.producerCommandDataChannel&&(e===Wn.UPDATE_DISPLAY_LAYOUT||e===Wn.REPORT_PERF_STAT)}static _isDataChannelResponseRequired(e){return e===Wn.UPDATE_DISPLAY_LAYOUT||e===Wn.REPORT_PERF_STAT}getNextCommandSequenceNumber(){return this.sequence}hangup(e){return v(this,null,(function*(){return this._send(Wn.HANGUP,{reason:e}).catch((()=>{}))}))}sendCandidate(e,t){return v(this,null,(function*(){return this._send(Wn.TRANSMIT_DATA,{participantId:e,data:{candidate:t}})}))}requestTestMode(e){return v(this,null,(function*(){return this._send(Wn.REQUEST_TEST_MODE,{consumerCommand:e})}))}sendSdp(e,t){return v(this,null,(function*(){return this._send(Wn.TRANSMIT_DATA,{participantId:e,data:{sdp:t}})}))}acceptCall(e){return v(this,null,(function*(){return this._send(Wn.ACCEPT_CALL,{mediaSettings:e})}))}changeMediaSettings(e){return v(this,null,(function*(){return this._send(Wn.CHANGE_MEDIA_SETTINGS,{mediaSettings:e},10)}))}changeParticipantState(e){return v(this,null,(function*(){return this._send(Wn.CHANGE_PARTICIPANT_STATE,{participantState:{state:e}})}))}addParticipant(e,t){return v(this,null,(function*(){return this._send(Wn.ADD_PARTICIPANT,((e,t)=>{for(var n in t||(t={}))h.call(t,n)&&g(e,n,t[n]);if(p)for(var n of p(t))f.call(t,n)&&g(e,n,t[n]);return e})({participantId:e},t))}))}removeParticipant(e,t=!1){return v(this,null,(function*(){return this._send(Wn.REMOVE_PARTICIPANT,{participantId:e,ban:t})}))}allocateConsumer(e,t){return v(this,null,(function*(){let n={capabilities:t};return e&&(n.description=e.sdp),this._send(Wn.ALLOCATE_CONSUMER,n)}))}acceptProducer(e,t){return v(this,null,(function*(){let n={description:e.sdp};return t&&(n.ssrcs=t),this._send(Wn.ACCEPT_PRODUCER,n)}))}changePriorities(e){return v(this,null,(function*(){return this._send(Wn.CHANGE_STREAM_PRIORITIES,{typedPriorities:e}).catch((()=>{}))}))}updateDisplayLayout(e){return v(this,null,(function*(){return this._send(Wn.UPDATE_DISPLAY_LAYOUT,{layouts:e})}))}addMovie(e){return v(this,null,(function*(){return this._send(Wn.ADD_MOVIE,e)}))}updateMovie(e){return v(this,null,(function*(){return this._send(Wn.UPDATE_MOVIE,e)}))}removeMovie(e){return v(this,null,(function*(){return this._send(Wn.REMOVE_MOVIE,e)}))}startStream(e){return v(this,null,(function*(){return this._send(Wn.RECORD_START,e)}))}stopStream(){return v(this,null,(function*(){return this._send(Wn.RECORD_STOP)}))}recordSetRole(e,t){return v(this,null,(function*(){return this._send(Wn.RECORD_SET_ROLE,{participantId:e,role:t})}))}getRecordStatus(){return v(this,null,(function*(){return this._send(Wn.RECORD_GET_STATUS)}))}switchTopology(e,t=!1){return v(this,null,(function*(){return this._send(Wn.SWITCH_TOPOLOGY,{topology:e,force:t})}))}requestRealloc(){return v(this,null,(function*(){return this._send(Wn.REQUEST_REALLOC)}))}reportPerfStat(e){return v(this,null,(function*(){return this._send(Wn.REPORT_PERF_STAT,{report:e})}))}chatMessage(e,t=null){return v(this,null,(function*(){return this._send(Wn.CHAT_MESSAGE,{message:e,participantId:t})}))}chatHistory(e){return v(this,null,(function*(){return this._send(Wn.CHAT_HISTORY,{count:e})}))}customData(e,t){return v(this,null,(function*(){return this._send(Wn.CUSTOM_DATA,{data:e,participantId:t})}))}grantRoles(e,t,n){return v(this,null,(function*(){let r={participantId:e,roles:t};return n&&(r.revoke=!0),this._sendRaw(Wn.GRANT_ROLES,r)}))}muteParticipant(e,t,n){return v(this,null,(function*(){return this._sendRaw(Wn.MUTE_PARTICIPANT,{participantId:e,muteStates:t,requestedMedia:n})}))}pinParticipant(e,t){return v(this,null,(function*(){let n={participantId:e};return t&&(n.unpin=!0),this._sendRaw(Wn.PIN_PARTICIPANT,n)}))}updateMediaModifiers(e){return v(this,null,(function*(){return this._send(Wn.UPDATE_MEDIA_MODIFIERS,{mediaModifiers:e})}))}changeOptions(e){return v(this,null,(function*(){return this._send(Wn.CHANGE_OPTIONS,{options:e})}))}getWaitingHall(e=null,t,n=!1){return v(this,null,(function*(){let r={};return e&&(r.fromId=e),t&&(r.count=t),n&&(r.backward=n),this._send(Wn.GET_WAITING_HALL,r)}))}promoteParticipant(e,t=!1){return v(this,null,(function*(){let n={participantId:e};return t&&(n.demote=t),this._sendRaw(Wn.PROMOTE_PARTICIPANT,n)}))}close(){this.socket&&this.socket.readyState<WebSocket.CLOSING&&this._closeSocket(),this._stopWaitConnectionMessage(),this._stopDoctor(),clearTimeout(this.reconnectTimer)}readyToSend(){this.listenersReady=!0,this._handleCachedMessages()}_connect(e){if(this.socket&&this.socket.readyState<WebSocket.CLOSING)return;let t="";e&&(t+=`&tgt=${e}`),e===q.RETRY&&this.lastStamp&&(t+=`&recoverTs=${this.lastStamp}`),Gt.debug("Connecting to "+this.endpoint+this.postfix+t),this.socket=new WebSocket(this.endpoint+this.postfix+t),this.socket.onopen=this._onOpen.bind(this),this.socket.onmessage=this._onMessage.bind(this),this.socket.onerror=this._onError.bind(this),this.socket.onclose=this._onClose.bind(this),this._startDoctor()}_disconnect(){this.socket&&this.socket.readyState<WebSocket.CLOSING&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.close(),this.socket=null),this._stopWaitConnectionMessage(),this._stopDoctor(),clearTimeout(this.reconnectTimer)}_onOpen(){Gt.debug("Socket opened"),De.log(Z.SOCKET_ACTION,"opened"),this._waitConnectionMessage(),this._startDoctor()}_onMessage(e){if(this._startDoctor(),"ping"!==e.data)try{this._handleMessage(JSON.parse(e.data))}catch(t){De.log(Z.SOCKET_ACTION,"parse_error"),Gt.error("Unable to parse message",t,e.data)}else this.socket&&this.socket.readyState===WebSocket.OPEN&&this.socket.send("pong")}_handleMessage(e){var t;"notification"===e.type?"connection"===e.notification?(Gt.debug("Signaling connected",e),this.connected=!0,this.reconnectCount=0,this.endpoint=e.endpoint,e.peerId&&this.peerId!==e.peerId.id&&(this.postfix+=`&peerId=${e.peerId.id}`,this.peerId=e.peerId.id),this._stopWaitConnectionMessage(),this.conversationResolve?this.conversationResolve(e):(this._triggerEvent(Y.RECONNECT,e),e.conversation.topology&&this._triggerEvent(Y.NOTIFICATION,{type:"notification",notification:X.TOPOLOGY_CHANGED,topology:e.conversation.topology})),this.lastStamp&&this._handleCachedMessages(),null==(t=e.recoverMessages)||t.forEach((e=>this._handleMessage(e))),this._handleCommandsQueue(this.websocketCommandsQueue)):this.connected&&this.listenersReady?this._triggerEvent(Y.NOTIFICATION,e):this.incomingCache.push(e):"response"===e.type&&this.responseHandlers[e.sequence]?this._handleCommandResponse(!0,e):"error"===e.type&&this.responseHandlers[e.sequence]?(De.log(Z.SOCKET_ACTION,`error-${e.error}`),this._handleCommandResponse(!1,e)):"error"===e.type?(De.log(Z.SOCKET_ACTION,`error-${e.error}`),"service-unavailable"===e.error?this._reconnect():"conversation-ended"===e.error?this.conversationReject?this.conversationReject(new Ue(F.SOCKET_CLOSED,{message:`Unable to connect to the signaling: ${e.error}`})):this._triggerEvent(Y.NOTIFICATION,{notification:X.CLOSED_CONVERSATION,reason:e.reason}):this.connected||"invalid-token"===e.error?this._throwError(new Error(`Signaling error: ${e.error}`)):e.sequence||(this.conversationReject&&this.conversationReject(new Ue(B.SIGNALING_FAILED,{message:`Unable to connect to the signaling: ${e.error}`})),this._closeSocket())):(De.log(Z.SOCKET_ACTION,"unknown_message"),Gt.warn("Unhandled message",e)),this.lastStamp=e.stamp||this.lastStamp}_handleCachedMessages(){let e=[...this.incomingCache];for(this.incomingCache=[];e.length>0;){let t=e.shift();this._handleMessage(t)}}_throwError(e){this._triggerEvent(Y.FAILED,e)}_onError(e){De.log(Z.SOCKET_ACTION,"error"),Gt.error("Signaling error",e)}_onClose(e){De.log(Z.SOCKET_ACTION,"closed"),Gt.debug("Connection closed",{code:e.code,reason:e.reason}),this.connected=!1,this._stopDoctor(),this.socket&&this.reconnectCount++<Hn.RECONNECT_MAX_COUNT?this._reconnect():this.socket&&this._closeSocket(new Error("Connection closed"))}_closeSocket(e=null){!this.socket||(this._disconnect(),Object.values(this.responseHandlers).forEach((t=>{window.clearTimeout(t.responseTimer),e&&t.reject(new Error("Connection closed"),!0)})),this.websocketCommandsQueue=[],this.responseHandlers={},this.lastStamp=0,e&&this._throwError(new Error("Connection closed")))}_reconnect(){let e=Math.min(Hn.RECONNECT_MAX_DELAY,Hn.RECONNECT_DELAY*Math.pow(2,this.reconnectCount-1));Gt.log(`Reconnect websocket after ${e}ms (${this.reconnectCount})`),De.log(Z.SOCKET_ACTION,"reconnect"),this.reconnectTimer=window.setTimeout(this._connect.bind(this,q.RETRY),e)}_handleCommandResponse(e,t){var n;if(!this.responseHandlers.hasOwnProperty(t.sequence))return;let r=this.responseHandlers[t.sequence];window.clearTimeout(r.responseTimer),e?(delete this.responseHandlers[t.sequence],r.resolve(t)):(null==(n=this.socket)?void 0:n.readyState)===WebSocket.OPEN?(delete this.responseHandlers[t.sequence],De.log(Z.SOCKET_ACTION,"response-timeout"),r.reject(new Error(t.error||`Response timeout [${r.name}]`))):r.responseTimer=window.setTimeout((()=>this._handleCommandResponse(!1,t)),Hn.WAIT_RESPONSE_DELAY)}_handleCommandsQueue(e){for(var t,n;e.length>0;){let r=e.shift(),o=Object.assign({command:r.name,sequence:r.sequence},r.params);if(this._isDataChannelCommand(r.name)){if((null==(t=this.producerCommandDataChannel)?void 0:t.readyState)!==jn)return void r.reject(new Error(`Invalid data channel state: ${null==(n=this.producerCommandDataChannel)?void 0:n.readyState}`));Hn._isDataChannelResponseRequired(r.name)&&(r.responseTimer=window.setTimeout((()=>this._handleCommandResponse(!1,o)),Hn.WAIT_RESPONSE_DELAY),this.responseHandlers[r.sequence]=r),this.producerCommandDataChannel.send(JSON.stringify(o))}else{if(!this.socket||this.socket.readyState!==WebSocket.OPEN){r.reject(new Error("Invalid state or socket already closed"));continue}r.responseTimer=window.setTimeout((()=>this._handleCommandResponse(!1,o)),Hn.WAIT_RESPONSE_DELAY),this.responseHandlers[r.sequence]=r,this.socket.send(JSON.stringify(o))}}}_waitConnectionMessage(){this.connectionMessageWaitTimer=window.setTimeout((()=>{this.conversationReject&&this.conversationReject(new Ue(B.SIGNALING_FAILED,{message:"Unable to connect to the signaling: connection timeout"}))}),Hn.WAIT_CONNECTION_DELAY)}_stopWaitConnectionMessage(){window.clearTimeout(this.connectionMessageWaitTimer),this.connectionMessageWaitTimer=0}_startDoctor(){this._stopDoctor(),this.doctorTimer=window.setTimeout((()=>{Gt.warn("Socket is dead, trying to reconnect"),this._disconnect(),this._connect(q.RETRY)}),Hn.WAIT_MESSAGE_DELAY)}_stopDoctor(){window.clearTimeout(this.doctorTimer),this.doctorTimer=0}},Kn=Hn;Kn.RECONNECT_DELAY=Rt.signalingReconnectDelay,Kn.RECONNECT_MAX_DELAY=Rt.signalingReconnectMaxDelay,Kn.RECONNECT_MAX_COUNT=Rt.signalingReconnectMaxCount,Kn.WAIT_CONNECTION_DELAY=Rt.waitConnectionDelay,Kn.WAIT_RESPONSE_DELAY=Rt.waitResponseDelay,Kn.WAIT_MESSAGE_DELAY=Rt.waitMessageDelay;var Gn=(e=>(e.KING="KING",e.PAWN="PAWN",e))(Gn||{});Et.getCameras,Et.getMicrophones,Et.getOutput,Et.hasCamera,Et.hasMicrophone,Et.getSavedCamera,Et.getSavedMicrophone,Et.getSavedOutput,Et.hasCameraPermission,Et.hasMicrophonePermission,Et.hasPermissions,Et.getUserMedia,Et.getUserVideo,Et.getUserAudio,Et.saveDeviceId,Et.isBrowserSupported,Et.isScreenCapturingSupported,Et.os,Et.isMobile,Et.browserName,Et.browserVersion,Et.baseChromeVersion,Et.getAudioContext},4022:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 16 16",u="videocam_16",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="videocam_16"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.75a2 2 0 00-2 2v4.5a2 2 0 002 2h5a2 2 0 002-2v-4.5a2 2 0 00-2-2H4zm11 2.2a.454.454 0 00-.103-.286c-.171-.21-.53-.19-.723-.095-.193.095-1.571.788-1.571.788a.233.233 0 00-.103.191v2.88c0 .075.038.145.103.19 0 0 1.097.548 1.571.789.434.22.826.033.826-.382V5.951z" fill="currentColor" /></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?16:+e.width,height:isNaN(e.height)?16:+e.height}))};p.mountIcon=_;const h=p},33024:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="cancel_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="cancel_24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><path d="M18.3 5.7a.99.99 0 00-1.4 0L12 10.6 7.1 5.7a.99.99 0 00-1.4 1.4l4.9 4.9-4.9 4.9a.99.99 0 001.4 1.4l4.9-4.9 4.9 4.9a.99.99 0 001.4-1.4L13.4 12l4.9-4.9a.99.99 0 000-1.4z" fill="currentColor" /></g></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},10902:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="error_circle_outline_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="error_circle_outline_24"><path d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm0 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm0 14a1.333 1.333 0 110 2.667A1.333 1.333 0 0112 16zm.324-10.667a1 1 0 011 1.037l-.266 7.276a1.059 1.059 0 01-2.116 0l-.265-7.276a1 1 0 01.963-1.036h.684z" fill="currentColor" /></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},15653:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="menu_outline_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="menu_outline_24"><path d="M21 11H3a1 1 0 100 2h18a1 1 0 100-2zm0-7H3a1 1 0 000 2h18a1 1 0 100-2zM3 20h18a1 1 0 100-2H3a1 1 0 100 2z" fill="currentColor" /></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},81536:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="more_horizontal_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="more_horizontal_24"><g fill="none" fill-rule="evenodd"><path d="M24 0H0v24h24z" /><path d="M18 10c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm-6 4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6 0c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor" /></g></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},21114:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="narrative_active_outline_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="narrative_active_outline_24"><path d="M14.298 1.435c.732.17 1.377.543 1.891 1.092.521.556.825 1.145 1.151 2.298l.79 2.944a1 1 0 11-1.931.518l-.72-2.69-.113-.401c-.215-.729-.377-1.024-.636-1.302a1.726 1.726 0 00-.887-.512c-.37-.086-.707-.078-1.445.1l-.405.104L6.866 4.96c-.854.228-1.254.394-1.51.583l-.06.047-.134.119c-.26.243-.43.539-.512.886-.093.4-.076.763.148 1.638l2.723 10.17.113.401c.215.729.377 1.024.636 1.302.244.26.54.43.887.512.401.093.745.076 1.607-.14a1 1 0 11.487 1.94c-1.148.288-1.805.32-2.549.147a3.726 3.726 0 01-1.891-1.092c-.521-.556-.825-1.145-1.151-2.298L2.922 8.963c-.355-1.324-.405-2.027-.22-2.823a3.722 3.722 0 01.93-1.728l.183-.182.179-.157c.496-.412 1.077-.685 2.091-.973l.263-.072 5.128-1.374c1.323-.355 2.026-.405 2.822-.22zM18.368 11c2 0 3.632 1.592 3.632 3.567 0 1.91-.772 2.851-3.78 5.134l-1.328 1.007c-.527.4-1.257.4-1.784 0l-1.328-1.007C10.772 17.418 10 16.476 10 14.567 10 12.592 11.631 11 13.632 11c.829 0 1.595.224 2.282.66l.086.057.086-.057a4.174 4.174 0 012.036-.653z" fill="currentColor" /></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},62199:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 24 24",u="write_24",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="write_24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><path d="M14.188 6.273l3.54 3.54-8.624 8.622a6.674 6.674 0 01-2.77 1.664l-2.903.886a.334.334 0 01-.416-.416l.886-2.902a6.674 6.674 0 011.664-2.771l8.623-8.623zm1.061-1.06l1.769-1.77a1.5 1.5 0 012.121 0l1.418 1.419a1.5 1.5 0 010 2.121L18.79 8.752l-3.54-3.54z" fill="currentColor" /></g></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};p.mountIcon=_;const h=p},87083:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 28 28",u="add_outline_28",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" id="add_outline_28"><g fill="none" fill-rule="evenodd"><path d="M0 0h28v28H0z" /><path d="M14 4a1 1 0 011 1v8h8a1 1 0 010 2h-8v8a1 1 0 01-2 0v-8H5a1 1 0 010-2h8V5a1 1 0 011-1z" fill="currentColor" fill-rule="nonzero" /></g></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?28:+e.width,height:isNaN(e.height)?28:+e.height}))};p.mountIcon=_;const h=p},88124:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var r=n(67294),o=n(87854),i=n.n(o),a=n(8091),s=n(34777),c=n(79333),l="0 0 36 36",u="add_36",d=!1;function _(){d||((0,s.addSpriteSymbol)(new(i())({id:u,viewBox:l,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" id="add_36"><g fill="none" fill-rule="evenodd"><path d="M0 0h36v36H0z" /><path d="M19.5 19.5v9a1.5 1.5 0 01-3 0v-9h-9a1.5 1.5 0 010-3h9v-9a1.5 1.5 0 013 0v9h9a1.5 1.5 0 010 3h-9z" fill="currentColor" /></g></symbol>'})),d=!0)}var p=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(c.SvgIcon,(0,a.assign)({},e,{viewBox:l,id:u,width:isNaN(e.width)?36:+e.width,height:isNaN(e.height)?36:+e.height}))};p.mountIcon=_;const h=p},76854:(e,t,n)=>{"use strict";n.d(t,{IconSettingsContext:()=>i,IconSettingsProvider:()=>a});var r=n(67294);function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=(0,r.createContext)({}),a=function(e){var t=e.children,n=o(e,["children"]),a=(0,r.useMemo)((function(){return n}),[n.classPrefix,n.globalClasses]);return r.createElement(i.Provider,{value:a},t)}},79333:(e,t,n)=>{"use strict";n.d(t,{SvgIcon:()=>d});var r=n(67294),o=n(76854);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var u={display:"block"};var d=function(e){var t=e.width,n=e.height,a=e.viewBox,c=e.id,d=e.className,_=e.style,p=e.fill,h=e.getRootRef,f=e.Component,m=l(e,["width","height","viewBox","id","className","style","fill","getRootRef","Component"]),g=Math.max(t,n),v=(0,r.useContext)(o.IconSettingsContext),y=function(e,t){for(var n=t.classPrefix,r=t.globalClasses,o="",i=0;i<e.length;i++)n&&(o+=" "+(n+e[i])),n&&!r||(o+=" "+e[i]);return o}(["Icon","Icon--".concat(g),"Icon--w-".concat(t),"Icon--h-".concat(n),"Icon--".concat(c)],v);return r.createElement(f,i({role:"presentation"},m,{ref:h,className:"".concat(y," ").concat(d),style:s(s({},_),{},{width:t,height:n})}),r.createElement("svg",{viewBox:a,width:t,height:n,style:u},r.createElement("use",{xlinkHref:"#".concat(c),style:{fill:"currentColor",color:p}})))};d.defaultProps={Component:"div",className:"",style:{}}},34777:(e,t,n)=>{"use strict";n.d(t,{addSpriteSymbol:()=>u,useIsomorphicLayoutEffect:()=>d});var r,o=n(62548),i=n.n(o),a=n(67294),s=!("undefined"==typeof window||!window.document||!window.document.createElement);if(s){var c="__SVG_SPRITE_NODE__";r=new(i())({attrs:{id:c}});var l=function(){var e=document.getElementById(c);e?r.attach(e):r.mount()};document.querySelector("body")?l():document.addEventListener("DOMContentLoaded",l)}else r=null;function u(e){r&&r.add(e)}var d=s?a.useLayoutEffect:a.useEffect},6257:e=>{var t=function(){"undefined"!=typeof document&&document.currentScript&&document.currentScript.src;return function(e){var t,n,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,r){t=e,n=r}));var o,i={};for(o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);var a,s=[],c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),c=0!==c.indexOf("blob:")?c.substr(0,c.lastIndexOf("/")+1):"";var l=r.print||console.log.bind(console),u=r.printErr||console.warn.bind(console);for(o in i)i.hasOwnProperty(o)&&(r[o]=i[o]);i=null,r.arguments&&(s=r.arguments),r.thisProgram&&r.thisProgram,r.quit&&r.quit;var d,_=0;r.wasmBinary&&(d=r.wasmBinary);var p;r.noExitRuntime;"object"!=typeof WebAssembly&&V("no native wasm support detected");var h=!1;var f="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function m(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&f)return f.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var l=a-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function g(e,t){return e?m(E,e,t):""}var v,y,E,w,b,C,S,T,D,P="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function A(e,t){for(var n=e,r=n>>1,o=r+t/2;!(r>=o)&&b[r];)++r;if((n=r<<1)-e>32&&P)return P.decode(E.subarray(e,n));for(var i="",a=0;!(a>=t/2);++a){var s=w[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function k(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,o=(n-=2)<2*e.length?n/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);w[t>>1]=a,t+=2}return w[t>>1]=0,t-r}function I(e){return 2*e.length}function O(e,t){for(var n=0,r="";!(n>=t/4);){var o=C[e+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;r+=String.fromCharCode(55296|i>>10,56320|1023&i)}else r+=String.fromCharCode(o)}return r}function x(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,o=r+n-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i);if(C[t>>2]=a,(t+=4)+4>o)break}return C[t>>2]=0,t-r}function R(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}function M(e){v=e,r.HEAP8=y=new Int8Array(e),r.HEAP16=w=new Int16Array(e),r.HEAP32=C=new Int32Array(e),r.HEAPU8=E=new Uint8Array(e),r.HEAPU16=b=new Uint16Array(e),r.HEAPU32=S=new Uint32Array(e),r.HEAPF32=T=new Float32Array(e),r.HEAPF64=D=new Float64Array(e)}r.INITIAL_MEMORY;var L,N=[],B=[],U=[];var F=0,W=null,j=null;function V(e){r.onAbort&&r.onAbort(e),u(e+=""),h=!0,1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}r.preloadedImages={},r.preloadedAudios={};var H,K;function G(e){return e.startsWith("data:application/octet-stream;base64,")}function z(e){try{if(e==H&&d)return new Uint8Array(d);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function q(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?L.get(n)():L.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(r)}}function $(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}G(H="libvpx.wasm")||(K=H,H=r.locateFile?r.locateFile(K,c):c+K);var Y=void 0;function Q(e){for(var t="",n=e;E[n];)t+=Y[E[n++]];return t}var X={},J={},Z={};function ee(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function te(e,t){return e=ee(e),function(){return t.apply(this,arguments)}}function ne(e,t){var n=te(t,(function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var re=void 0;function oe(e){throw new re(e)}var ie=void 0;function ae(e){throw new ie(e)}function se(e,t,n){function r(t){var r=n(t);r.length!==e.length&&ae("Mismatched type converter count");for(var o=0;o<e.length;++o)ce(e[o],r[o])}e.forEach((function(e){Z[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){J.hasOwnProperty(e)?o[t]=J[e]:(i.push(e),X.hasOwnProperty(e)||(X[e]=[]),X[e].push((function(){o[t]=J[e],++a===i.length&&r(o)})))})),0===i.length&&r(o)}function ce(e,t,n){if(n=n||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(e||oe('type "'+r+'" must have a positive integer typeid pointer'),J.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;oe("Cannot register type '"+r+"' twice")}if(J[e]=t,delete Z[e],X.hasOwnProperty(e)){var o=X[e];delete X[e],o.forEach((function(e){e()}))}}function le(e){if(!(this instanceof be))return!1;if(!(e instanceof be))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)o=r.upcast(o),r=r.baseClass;return t===r&&n===o}function ue(e){oe(e.$$.ptrType.registeredClass.name+" instance already deleted")}var de=!1;function _e(e){}function pe(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function he(e){return"undefined"==typeof FinalizationGroup?(he=function(e){return e},e):(de=new FinalizationGroup((function(e){for(var t=e.next();!t.done;t=e.next()){var n=t.value;n.ptr?pe(n):console.warn("object already deleted: "+n.ptr)}})),he=function(e){return de.register(e,e.$$,e.$$),e},_e=function(e){de.unregister(e.$$)},he(e))}function fe(){if(this.$$.ptr||ue(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=he(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function me(){this.$$.ptr||ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&oe("Object already scheduled for deletion"),_e(this),pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function ge(){return!this.$$.ptr}var ve=void 0,ye=[];function Ee(){for(;ye.length;){var e=ye.pop();e.$$.deleteScheduled=!1,e.delete()}}function we(){return this.$$.ptr||ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&oe("Object already scheduled for deletion"),ye.push(this),1===ye.length&&ve&&ve(Ee),this.$$.deleteScheduled=!0,this}function be(){}var Ce={};function Se(e,t,n){if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||oe("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}}function Te(e,t,n){r.hasOwnProperty(e)?((void 0===n||void 0!==r[e].overloadTable&&void 0!==r[e].overloadTable[n])&&oe("Cannot register public name '"+e+"' twice"),Se(r,e,e),r.hasOwnProperty(n)&&oe("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),r[e].overloadTable[n]=t):(r[e]=t,void 0!==n&&(r[e].numArguments=n))}function De(e,t,n,r,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Pe(e,t,n){for(;t!==n;)t.upcast||oe("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Ae(e,t){if(null===t)return this.isReference&&oe("null is not a valid "+this.name),0;t.$$||oe('Cannot pass "'+at(t)+'" as a '+this.name),t.$$.ptr||oe("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,n,this.registeredClass)}function ke(e,t){var n;if(null===t)return this.isReference&&oe("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||oe('Cannot pass "'+at(t)+'" as a '+this.name),t.$$.ptr||oe("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&oe("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;if(n=Pe(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&oe("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:oe("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var o=t.clone();n=this.rawShare(n,rt((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,n)}break;default:oe("Unsupporting sharing policy")}return n}function Ie(e,t){if(null===t)return this.isReference&&oe("null is not a valid "+this.name),0;t.$$||oe('Cannot pass "'+at(t)+'" as a '+this.name),t.$$.ptr||oe("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&oe("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;return Pe(t.$$.ptr,n,this.registeredClass)}function Oe(e){return this.fromWireType(S[e>>2])}function xe(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Re(e){this.rawDestructor&&this.rawDestructor(e)}function Me(e){null!==e&&e.delete()}function Le(e,t,n){if(t===n)return e;if(void 0===n.baseClass)return null;var r=Le(e,t,n.baseClass);return null===r?null:n.downcast(r)}function Ne(){return Object.keys(Fe).length}function Be(){var e=[];for(var t in Fe)Fe.hasOwnProperty(t)&&e.push(Fe[t]);return e}function Ue(e){ve=e,ye.length&&ve&&ve(Ee)}var Fe={};function We(e,t){return t=function(e,t){for(void 0===t&&oe("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Fe[t]}function je(e,t){return t.ptrType&&t.ptr||ae("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!==!!t.smartPtr&&ae("Both smartPtrType and smartPtr must be specified"),t.count={value:1},he(Object.create(e,{$$:{value:t}}))}function Ve(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=We(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function o(){return this.isSmartPointer?je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Ce[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var c=Le(t,this.registeredClass,i.registeredClass);return null===c?o.call(this):this.isSmartPointer?je(i.registeredClass.instancePrototype,{ptrType:i,ptr:c,smartPtrType:this,smartPtr:e}):je(i.registeredClass.instancePrototype,{ptrType:i,ptr:c})}function He(e,t,n,r,o,i,a,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,o||void 0!==t.baseClass?this.toWireType=ke:r?(this.toWireType=Ae,this.destructorFunction=null):(this.toWireType=Ie,this.destructorFunction=null)}function Ke(e,t,n){return e.includes("j")?function(e,t,n){var o=r["dynCall_"+e];return n&&n.length?o.apply(null,[t].concat(n)):o.call(null,t)}(e,t,n):L.get(t).apply(null,n)}function Ge(e,t){var n,r,o,i=(e=Q(e)).includes("j")?(n=e,r=t,o=[],function(){o.length=arguments.length;for(var e=0;e<arguments.length;e++)o[e]=arguments[e];return Ke(n,r,o)}):L.get(t);return"function"!=typeof i&&oe("unknown function pointer with signature "+e+": "+t),i}var ze=void 0;function qe(e){var t=ft(e),n=Q(t);return pt(t),n}function $e(e,t){var n=[],r={};throw t.forEach((function e(t){r[t]||J[t]||(Z[t]?Z[t].forEach(e):(n.push(t),r[t]=!0))})),new ze(e+": "+n.map(qe).join([", "]))}function Ye(e,t){for(var n=[],r=0;r<e;r++)n.push(C[(t>>2)+r]);return n}function Qe(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Xe(e,t,n,r,o){var i=t.length;i<2&&oe("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==n,s=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){s=!0;break}var l="void"!==t[0].name,u=i-2,d=new Array(u),_=[],p=[];return function(){var n;arguments.length!==u&&oe("function "+e+" called with "+arguments.length+" arguments, expected "+u+" args!"),p.length=0,_.length=a?2:1,_[0]=o,a&&(n=t[1].toWireType(p,this),_[1]=n);for(var i=0;i<u;++i)d[i]=t[i+2].toWireType(p,arguments[i]),_.push(d[i]);var c=r.apply(null,_);function h(e){if(s)Qe(p);else for(var r=a?1:2;r<t.length;r++){var o=1===r?n:d[r-2];null!==t[r].destructorFunction&&t[r].destructorFunction(o)}if(l)return t[0].fromWireType(e)}return h(c)}}var Je=[],Ze=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function et(e){e>4&&0==--Ze[e].refcount&&(Ze[e]=void 0,Je.push(e))}function tt(){for(var e=0,t=5;t<Ze.length;++t)void 0!==Ze[t]&&++e;return e}function nt(){for(var e=5;e<Ze.length;++e)if(void 0!==Ze[e])return Ze[e];return null}function rt(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Je.length?Je.pop():Ze.length;return Ze[t]={refcount:1,value:e},t}}function ot(e,t,n){switch(t){case 0:return function(e){var t=n?y:E;return this.fromWireType(t[e])};case 1:return function(e){var t=n?w:b;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=n?C:S;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function it(e,t){var n=J[e];return void 0===n&&oe(t+" has unknown type "+qe(e)),n}function at(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function st(e,t){switch(t){case 2:return function(e){return this.fromWireType(T[e>>2])};case 3:return function(e){return this.fromWireType(D[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function ct(e,t,n){switch(t){case 0:return n?function(e){return y[e]}:function(e){return E[e]};case 1:return n?function(e){return w[e>>1]}:function(e){return b[e>>1]};case 2:return n?function(e){return C[e>>2]}:function(e){return S[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function lt(e){try{return p.grow(e-v.byteLength+65535>>>16),M(p.buffer),1}catch(e){}}var ut={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=ut.buffers[e];0===t||10===t?((1===e?l:u)(m(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){return ut.varargs+=4,C[ut.varargs-4>>2]},getStr:function(e){return g(e)},get64:function(e,t){return e}};!function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Y=e}(),re=r.BindingError=ne(Error,"BindingError"),ie=r.InternalError=ne(Error,"InternalError"),be.prototype.isAliasOf=le,be.prototype.clone=fe,be.prototype.delete=me,be.prototype.isDeleted=ge,be.prototype.deleteLater=we,He.prototype.getPointee=xe,He.prototype.destructor=Re,He.prototype.argPackAdvance=8,He.prototype.readValueFromPointer=Oe,He.prototype.deleteObject=Me,He.prototype.fromWireType=Ve,r.getInheritedInstanceCount=Ne,r.getLiveInheritedInstances=Be,r.flushPendingDeletes=Ee,r.setDelayFunction=Ue,ze=r.UnboundTypeError=ne(Error,"UnboundTypeError"),r.count_emval_handles=tt,r.get_first_emval=nt;var dt,_t={y:function(e,t,n,r,o){},H:function(e,t,n,r,o){var i=$(n);ce(e,{name:t=Q(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:o},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===n)r=y;else if(2===n)r=w;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+t);r=C}return this.fromWireType(r[e>>i])},destructorFunction:null})},t:function(e,t,n,o,i,a,s,c,l,u,d,_,p){d=Q(d),a=Ge(i,a),c&&(c=Ge(s,c)),u&&(u=Ge(l,u)),p=Ge(_,p);var h=ee(d);Te(h,(function(){$e("Cannot construct "+d+" due to unbound types",[o])})),se([e,t,n],o?[o]:[],(function(t){var n,i;t=t[0],i=o?(n=t.registeredClass).instancePrototype:be.prototype;var s=te(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new re("Use 'new' to construct "+d);if(void 0===_.constructor_body)throw new re(d+" has no accessible constructor");var e=_.constructor_body[arguments.length];if(void 0===e)throw new re("Tried to invoke ctor of "+d+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(_.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),l=Object.create(i,{constructor:{value:s}});s.prototype=l;var _=new De(d,s,l,p,n,a,c,u),f=new He(d,_,!0,!1,!1),m=new He(d+"*",_,!1,!1,!1),g=new He(d+" const*",_,!1,!0,!1);return Ce[e]={pointerType:m,constPointerType:g},function(e,t,n){r.hasOwnProperty(e)||ae("Replacing nonexistant public symbol"),void 0!==r[e].overloadTable&&void 0!==n?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)}(h,s),[f,m,g]}))},p:function(e,t,n,r,o,i){var a;t>0||V("Assertion failed: "+a);var s=Ye(t,n);o=Ge(r,o),se([],[e],(function(e){var n="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new re("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){$e("Cannot construct "+e.name+" due to unbound types",s)},se([],s,(function(r){return r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Xe(n,r,null,o,i),[]})),[]}))},e:function(e,t,n,r,o,i,a,s){var c=Ye(n,r);t=Q(t),i=Ge(o,i),se([],[e],(function(e){var r=(e=e[0]).name+"."+t;function o(){$e("Cannot call "+r+" due to unbound types",c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,u=l[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===n-2?(o.argCount=n-2,o.className=e.name,l[t]=o):(Se(l,t,r),l[t].overloadTable[n-2]=o),se([],c,(function(o){var s=Xe(r,o,e,i,a);return void 0===l[t].overloadTable?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]})),[]}))},G:function(e,t){ce(e,{name:t=Q(t),fromWireType:function(e){var t=Ze[e].value;return et(e),t},toWireType:function(e,t){return rt(t)},argPackAdvance:8,readValueFromPointer:Oe,destructorFunction:null})},L:function(e,t,n,r){var o=$(n);function i(){}t=Q(t),i.values={},ce(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:ot(t,o,r),destructorFunction:null}),Te(t,i)},x:function(e,t,n){var r=it(e,"enum");t=Q(t);var o=r.constructor,i=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:te(r.name+"_"+t,(function(){}))}});o.values[n]=i,o[t]=i},r:function(e,t,n){var r=$(n);ce(e,{name:t=Q(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+at(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:st(t,r),destructorFunction:null})},h:function(e,t,n,r,o){t=Q(t),-1===o&&(o=4294967295);var i=$(n),a=function(e){return e};if(0===r){var s=32-8*n;a=function(e){return e<<s>>>s}}var c=t.includes("unsigned");ce(e,{name:t,fromWireType:a,toWireType:function(e,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+at(n)+'" to '+this.name);if(n<r||n>o)throw new TypeError('Passing a number "'+at(n)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+o+"]!");return c?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:ct(t,i,0!==r),destructorFunction:null})},g:function(e,t,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=S,n=t[e>>=2],o=t[e+1];return new r(v,o,n)}ce(e,{name:n=Q(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},s:function(e,t){var n="std::string"===(t=Q(t));ce(e,{name:t,fromWireType:function(e){var t,r=S[e>>2];if(n)for(var o=e+4,i=0;i<=r;++i){var a=e+4+i;if(i==r||0==E[a]){var s=g(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var c=new Array(r);for(i=0;i<r;++i)c[i]=String.fromCharCode(E[e+4+i]);t=c.join("")}return pt(e),t},toWireType:function(e,t){var r;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||oe("Cannot pass non-string to std::string"),r=n&&o?function(){return function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}(t)}:function(){return t.length};var i=r(),a=ht(4+i+1);if(S[a>>2]=i,n&&o)(function(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=i)break;t[n++]=s}else if(s<=2047){if(n+1>=i)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=i)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}t[n]=0})(t,E,a+4,i+1);else if(o)for(var s=0;s<i;++s){var c=t.charCodeAt(s);c>255&&(pt(a),oe("String has UTF-16 code units that do not fit in 8 bits")),E[a+4+s]=c}else for(s=0;s<i;++s)E[a+4+s]=t[s];return null!==e&&e.push(pt,a),a},argPackAdvance:8,readValueFromPointer:Oe,destructorFunction:function(e){pt(e)}})},m:function(e,t,n){var r,o,i,a,s;n=Q(n),2===t?(r=A,o=k,a=I,i=function(){return b},s=1):4===t&&(r=O,o=x,a=R,i=function(){return S},s=2),ce(e,{name:n,fromWireType:function(e){for(var n,o=S[e>>2],a=i(),c=e+4,l=0;l<=o;++l){var u=e+4+l*t;if(l==o||0==a[u>>s]){var d=r(c,u-c);void 0===n?n=d:(n+=String.fromCharCode(0),n+=d),c=u+t}}return pt(e),n},toWireType:function(e,r){"string"!=typeof r&&oe("Cannot pass non-string to C++ string type "+n);var i=a(r),c=ht(4+i+t);return S[c>>2]=i>>s,o(r,c+4,i+t),null!==e&&e.push(pt,c),c},argPackAdvance:8,readValueFromPointer:Oe,destructorFunction:function(e){pt(e)}})},I:function(e,t){ce(e,{isVoid:!0,name:t=Q(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},F:function(){throw"longjmp"},k:et,l:function(e){e>4&&(Ze[e].refcount+=1)},j:function(e,t){return rt((e=it(e,"_emval_take_value")).readValueFromPointer(t))},E:function(){V()},C:function(e,t,n){E.copyWithin(e,t,t+n)},D:function(e){var t,n,r=E.length,o=2147483648;if((e>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=r*(1+.2/i);if(a=Math.min(a,e+100663296),lt(Math.min(o,((t=Math.max(e,a))%(n=65536)>0&&(t+=n-t%n),t))))return!0}return!1},q:function(e,t,n,r){for(var o=0,i=0;i<n;i++){for(var a=C[t+8*i>>2],s=C[t+(8*i+4)>>2],c=0;c<s;c++)ut.printChar(e,E[a+c]);o+=s}return C[r>>2]=o,0},a:function(){return _},f:function(e){var t=Date.now();return C[e>>2]=t/1e3|0,C[e+4>>2]=t%1e3*1e3|0,0},d:function(e,t,n){var r=mt();try{return L.get(e)(t,n)}catch(e){if(gt(r),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},n:function(e,t,n,r){var o=mt();try{return L.get(e)(t,n,r)}catch(e){if(gt(o),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},o:function(e,t,n,r,o){var i=mt();try{return L.get(e)(t,n,r,o)}catch(e){if(gt(i),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},u:function(e,t,n,r,o,i){var a=mt();try{return L.get(e)(t,n,r,o,i)}catch(e){if(gt(a),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},K:function(e,t,n,r,o,i,a,s,c){var l=mt();try{return L.get(e)(t,n,r,o,i,a,s,c)}catch(e){if(gt(l),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},B:function(e,t,n,r,o,i,a,s){var c=mt();try{return yt(e,t,n,r,o,i,a,s)}catch(e){if(gt(c),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},z:function(e,t,n,r){var o=mt();try{return wt(e,t,n,r)}catch(e){if(gt(o),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},i:function(e,t){var n=mt();try{L.get(e)(t)}catch(e){if(gt(n),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},w:function(e,t,n){var r=mt();try{L.get(e)(t,n)}catch(e){if(gt(r),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},c:function(e,t,n,r,o){var i=mt();try{L.get(e)(t,n,r,o)}catch(e){if(gt(i),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},J:function(e,t,n,r,o,i,a){var s=mt();try{L.get(e)(t,n,r,o,i,a)}catch(e){if(gt(s),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},v:function(e,t,n,r,o,i,a,s,c){var l=mt();try{L.get(e)(t,n,r,o,i,a,s,c)}catch(e){if(gt(l),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},A:function(e,t,n,r,o,i,a,s,c,l){var u=mt();try{Et(e,t,n,r,o,i,a,s,c,l)}catch(e){if(gt(u),e!==e+0&&"longjmp"!==e)throw e;vt(1,0)}},b:function(e){_=e}},pt=(function(){var e={a:_t};function t(e,t){var n,o=e.exports;r.asm=o,M((p=r.asm.M).buffer),L=r.asm.Q,n=r.asm.N,B.unshift(n),function(e){if(F--,r.monitorRunDependencies&&r.monitorRunDependencies(F),0==F&&(null!==W&&(clearInterval(W),W=null),j)){var t=j;j=null,t()}}()}function o(e){t(e.instance)}function i(t){return(d||"function"!=typeof fetch?Promise.resolve().then((function(){return z(H)})):fetch(H,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+H+"'";return e.arrayBuffer()})).catch((function(){return z(H)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){u("failed to asynchronously prepare wasm: "+e),V(e)}))}if(F++,r.monitorRunDependencies&&r.monitorRunDependencies(F),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){return u("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||G(H)||"function"!=typeof fetch?i(o):fetch(H,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return u("wasm streaming compile failed: "+e),u("falling back to ArrayBuffer instantiation"),i(o)}))}))).catch(n)}(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.N).apply(null,arguments)},r._free=function(){return(pt=r._free=r.asm.O).apply(null,arguments)}),ht=r._malloc=function(){return(ht=r._malloc=r.asm.P).apply(null,arguments)},ft=r.___getTypeName=function(){return(ft=r.___getTypeName=r.asm.R).apply(null,arguments)},mt=(r.___embind_register_native_and_builtin_types=function(){return(r.___embind_register_native_and_builtin_types=r.asm.S).apply(null,arguments)},r.stackSave=function(){return(mt=r.stackSave=r.asm.T).apply(null,arguments)}),gt=r.stackRestore=function(){return(gt=r.stackRestore=r.asm.U).apply(null,arguments)},vt=r._setThrew=function(){return(vt=r._setThrew=r.asm.V).apply(null,arguments)},yt=r.dynCall_iiiijj=function(){return(yt=r.dynCall_iiiijj=r.asm.W).apply(null,arguments)},Et=(r.dynCall_iiijiii=function(){return(r.dynCall_iiijiii=r.asm.X).apply(null,arguments)},r.dynCall_vijjjid=function(){return(Et=r.dynCall_vijjjid=r.asm.Y).apply(null,arguments)}),wt=r.dynCall_iij=function(){return(wt=r.dynCall_iij=r.asm.Z).apply(null,arguments)};r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm._).apply(null,arguments)};function bt(e){function n(){dt||(dt=!0,r.calledRun=!0,h||(!0,q(B),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),U.unshift(e);var e;q(U)}()))}e=e||s,F>0||(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),N.unshift(e);var e;q(N)}(),F>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(j=function e(){dt||bt(),dt||(j=e)},r.run=bt,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return bt(),e.ready}}();e.exports=t,t.getUrl=function(e){return"https://st.mycdn.me/static/libvpx/2-0-9/"+e}},88882:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,{Config:()=>q,Connect:()=>fe});var o=["agreements","promo","vkc_behavior","vkc_auth_action","vkc_brand","vkc_display_mode","service_groups","external_device_id"],i=!("undefined"==typeof window||!window.document||!window.document.createElement),a=i&&!!window.addEventListener;function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e,t){return e(t={exports:{}},t.exports),t.exports}var l=s(c((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}))),u=function(){};if(a)try{var d=Object.defineProperty({},"passive",{get:function(){}});window.addEventListener("test",u,d),window.removeEventListener("test",u,d)}catch(r){}!function(){if(!i)return!1;try{document.createElement("div").scrollTo({top:0,get behavior(){return!0,"smooth"}})}catch(e){}}();var _=c((function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0}));s(_);var p=c((function(e){e.exports=function(e){if(Array.isArray(e))return _(e)},e.exports.default=e.exports,e.exports.__esModule=!0}));s(p);var h=c((function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0}));s(h);var f=c((function(e){e.exports=function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0}));s(f);var m=c((function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}));s(m),s(c((function(e){e.exports=function(e){return p(e)||h(e)||f(e)||m()},e.exports.default=e.exports,e.exports.__esModule=!0})));var g=s(c((function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0})));function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==l(e)||null===e)return"";t=y({encode:!0},t);var n=function(e){return t.encode?encodeURIComponent(e):String(e)};return Object.keys(e).reduce((function(r,o){var i=e[o];return void 0===i?r:null===i?(t.skipNull||r.push([n(o),""].join("=")),r):Array.isArray(i)?(i.map((function(e){r.push("".concat(n(o),"[]=").concat(n(e)))})).join(),r):(r.push([n(o),n(i)].join("=")),r)}),[]).join("&")};function w(e){return E(e)}function b(e){return Object.keys(e).filter((function(e){return o.includes(e)}))}function C(e){var t;return Boolean(null===(t=b(e))||void 0===t?void 0:t.length)}function S(e){var t=function(e){return b(e).reduce((function(t,n){return t[n]=e[n],t}),{})}(e);return btoa(JSON.stringify(t))}function T(e,t){var n,r,o=document.createElement("iframe");for(var i in e&&(o.src=e),o.style.cssText=null!==(n=null==t?void 0:t.cssText)&&void 0!==n?n:"",o.width="100%",o.height="100%",o.style.border="none",null==t?void 0:t.properties)t&&t.properties.hasOwnProperty(i)&&(o[i]=null!==(r=t.properties[i])&&void 0!==r?r:"");return o}function D(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&"object"===r(e)};return e.reduce((function(e,t){return Object.keys(t).forEach((function(r){var o=e[r],i=t[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat.apply(o,i):n(o)&&n(i)?e[r]=D(o,i):e[r]=i})),e}),{})}function P(e,t){return void 0===e?t:"number"!=typeof e?e?1:0:e}function A(e,t){return e&&"object"===r(e)?Object.keys(e).reduce((function(n,r){return t.includes(r)?(n[r]=e[r],n):n}),{}):e}s(c((function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0}))),s(c((function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0})));var k,I,O,x=new(function(){function e(){this.savedStyles=[],this.bodyScrollYValue=0,this.isFreezed=!1}return e.prototype.freezeBodyOverflow=function(){if(!this.isFreezed){this.isFreezed=!0;var e=(n=window.document.documentElement.clientWidth,Math.abs(window.innerWidth-n)),t=parseInt(window.getComputedStyle(window.document.body).paddingRight,10)||0;this.bodyScrollYValue=window.pageYOffset||window.scrollY,this.savedStyles=[],this.savedStyles.push({value:window.document.body.style.paddingRight,property:"padding-right"},{value:window.document.body.style.overflow,property:"overflow"},{value:window.document.body.style.overflowX,property:"overflow-x"},{value:window.document.body.style.overflowY,property:"overflow-y"}),window.document.body.style.setProperty("overflow","hidden"),window.document.body.style.setProperty("padding-right",e+t+"px")}var n},e.prototype.restoreBodyOverflow=function(){this.isFreezed&&(this.savedStyles.forEach((function(e){var t=e.value,n=e.property;t?window.document.body.style.setProperty(n,t):window.document.body.style.removeProperty(n)})),window.scrollTo(0,this.bodyScrollYValue),this.isFreezed=!1)},e}());!function(e){e.OPEN="VKSDKOpen",e.CLOSE="VKSDKClose",e.LOGOUT="VKSDKLogout",e.GET_CAPTCHA="VKSDKGetCaptcha",e.AUTH_NEEDED="VKSDKAuthNeeded",e.UPDATE_PARAMS="VKSDKUpdateParams",e.REQUEST_SUPERAPP_TOKEN="VKSDKRequestSuperAppToken",e.ERROR="VKSDKError"}(k||(k={})),function(e){e.INIT="VKSDKInit"}(I||(I={})),function(e){e[e.UNKNOWN=1]="UNKNOWN",e[e.MISSING_PARAM=2]="MISSING_PARAM",e[e.CONNECTION_LOST=3]="CONNECTION_LOST",e[e.USER_DENIED=4]="USER_DENIED",e[e.INVALID_PARAMS=5]="INVALID_PARAMS",e[e.CUSTOM=6]="CUSTOM",e[e.LOADING_ERROR=7]="LOADING_ERROR",e[e.CONNECT_WINDOW_CLOSED=7]="CONNECT_WINDOW_CLOSED",e[e.CONNECT_WINDOW_NOT_OPENED=8]="CONNECT_WINDOW_NOT_OPENED",e[e.CONNECT_DOMAIN_NOT_ALLOWED=9]="CONNECT_DOMAIN_NOT_ALLOWED",e[e.CONNECT_UNKNOWN_SDK_MESSAGE=10]="CONNECT_UNKNOWN_SDK_MESSAGE",e[e.CONNECT_CLIENT_SDK_ERROR=11]="CONNECT_CLIENT_SDK_ERROR",e[e.OLD_MISSING_PARAM=100]="OLD_MISSING_PARAM"}(O||(O={}));var R,M,L,N,B=function(e,t){return'Wrong "'+e+'" param. '+(t||"")},U=function(e){return'URL domain "'+e+'" is not allowed.'},F=function(e){return"This SDK message is unknown: "+e},W=function(e){return e.error+";"+e.errorCode},j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},V=function(){return(V=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function H(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}!function(e){e.APP_CLOSE="VKWebAppClose",e.APP_READY="VKSDKMiniAppReady",e.RESIZE="VKSDKMiniAppResize",e.APP_INIT_CONFIG="VKSDKMiniAppInitConfig",e.OPEN_APP="VKWebAppOpenApp",e.OPEN_PAY_FORM="VKWebAppOpenPayForm",e.ACTION_DONE="VKWebAppActionDone",e.SET_TITLE="VKWebAppSetTitle",e.AUTH_BY_EXCHANGE_TOKEN="VKWebAppAuthByExchangeToken",e.FORCE_LOGOUT="VKWebAppForceLogout"}(R||(R={})),function(e){e.OPEN="open",e.HIDE="hide",e.CLOSE="close",e.SHOW="show",e.MESSAGE="message",e.CREATE_APP="createapp"}(M||(M={})),function(e){e.SUPERAPP_TOKEN="VKSDKGeneralSuperAppToken",e.AUTH_NEEDED="VKSDKGeneralAuthNeeded",e.OPEN_APP="VKSDKGeneralOpenApp"}(L||(L={})),function(e){e.SUPERAPP_TOKEN_CHANGE_V2="superAppTokenV2",e.SUPERAPP_TOKEN_CHANGE="superAppToken"}(N||(N={}));var K,G={appId:0,superAppToken:"",superAppTokenV2:"",loginDomain:"login.vk.com",oauthDomain:"oauth.vk.com",connectDomain:"id.vk.com",_debug:!1,_localhost:!1},z={},q=function(){function e(){}return e.init=function(e){if(!e.appId)throw new Error("appId required");G.appId=e.appId,G.superAppToken=e.superAppToken||"",G.superAppTokenV2=e.superAppTokenV2||"",G.loginDomain=e.loginDomain||"login.vk.com",G.oauthDomain=e.oauthDomain||"oauth.vk.com",G.connectDomain=e.connectDomain||"id.vk.com",G.appSettings=e.appSettings,G._debug=!!e._debug,G._localhost=!!e._localhost},e.get=function(){return G},e.setSuperAppToken=function(t,n){void 0===n&&(n={}),2===n.version?(G.superAppTokenV2=t,e.events.emit(N.SUPERAPP_TOKEN_CHANGE_V2,t)):(G.superAppToken=t,e.events.emit(N.SUPERAPP_TOKEN_CHANGE,t))},e.onRequestSuperAppToken=function(e){z.requestSuperAppToken=e},e._requestSuperAppToken=function(t,n){var r;void 0===n&&(n={}),z.requestSuperAppToken&&(r=z.requestSuperAppToken(t,n)),r&&r.then((function(t){return e.setSuperAppToken(t,n)})).catch(console.error)},e.onAuth=function(e){z.auth=e},e._auth=function(t){var n;void 0===t&&(t={}),z.auth&&(n=z.auth()),n&&n.then((function(n){e.setSuperAppToken(n,t)})).catch(console.error)},e.onOpenApp=function(e){z.openApp=e},e._openApp=function(e){z.openApp&&z.openApp(e.app)},e.onLogout=function(e){z.logout=e},e._logout=function(){z.logout&&z.logout()},e.events=H(),e}(),$=function(e){var t=this;this.handler=function(){return{}},this.destroy=function(){delete t.config,window.removeEventListener("message",t.handleMessage)},this.onMessage=function(e){t.handler=e},this.sendMessage=function(e){var n;null===(n=t.config.iframe.contentWindow)||void 0===n||n.postMessage(V({type:"vk-sak-sdk"},e),t.config.origin)},this.handleMessage=function(e){t.config.origin&&e.origin===t.config.origin&&e.source===t.config.iframe.contentWindow&&e.data&&"vk-sak-sdk"===e.data.type&&t.handler(e.data)},this.config=e,window.addEventListener("message",this.handleMessage)},Y=function e(t){var n=this;this.readyPromiseResolve=null,this.readyPromise=null,this.child=null,this.initialTitle=window.document.title,this.open=function(e,t){return n.loading?(n.iframe.src=n.getMiniAppUrl(e,t),n.loading=new Promise((function(e){n.iframe.onload=function(){n.iframe.onload=null,e()}})),n.readyPromise=new Promise((function(e){return n.readyPromiseResolve=e}))):n.preload(e,t).catch(console.error),n.iframe.style.display="block",n.params.stackMode||x.freezeBodyOverflow(),n.loading.then(n.handleResize).catch(console.error),n.events.emit(M.OPEN),n.readyPromise},this.hide=function(){n.iframe.style.display="none",n.params.stackMode||x.restoreBodyOverflow(),n.events.emit(M.HIDE)},this.close=function(e){window.document.title!==n.initialTitle&&(window.document.title=n.initialTitle),n.params.stackMode||x.restoreBodyOverflow(),n.iframe&&n.iframe.remove(),n.bridge&&n.bridge.destroy(),delete n.iframe,delete n.bridge,q.events.off(N.SUPERAPP_TOKEN_CHANGE,n.onSuperAppToken),window.removeEventListener("resize",n.handleResize),n.events.emit(M.CLOSE,e)},this.show=function(){if(!n.loading)throw new Error('App is not loaded, use "open" or "preload" methods');n.iframe.style.display="block",n.params.stackMode||x.freezeBodyOverflow(),n.events.emit(M.SHOW)},this.preload=function(e,t){var r=document.createElement("iframe"),o=window.innerHeight,i=isFinite(n.params.zIndex)?n.params.zIndex:999999;return r.src=n.getMiniAppUrl(e,t),r.setAttribute("allow","geolocation"),r.style.cssText="\n      display: none;\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: "+o+"px;\n      min-height: "+o+"px;\n      border: none;\n      z-index: "+i+";\n    ",n.iframe=r,document.body.appendChild(n.iframe),n.bridge=new $({iframe:n.iframe,origin:"https://"+q.get().connectDomain}),n.loading=new Promise((function(e){r.onload=function(){r.onload=null,e()}})),n.readyPromise=new Promise((function(e){return n.readyPromiseResolve=e})),n.bridge.onMessage(n.handleMessage),q.events.on(N.SUPERAPP_TOKEN_CHANGE,n.onSuperAppToken),window.addEventListener("resize",n.handleResize),n.loading},this.sendMessage=function(e){n.bridge.sendMessage(e)},this.onSuperAppToken=function(e){n.bridge.sendMessage({handler:L.SUPERAPP_TOKEN,params:{result:e}})},this.handleMessage=function(e){switch(e.handler){case R.APP_CLOSE:n.hide();break;case R.APP_READY:n.resolveReadyPromise(),n.handleUpdateConfig();break;case R.OPEN_APP:n.openMiniapp(e.params);break;case R.OPEN_PAY_FORM:n.openPayForm(e.params);break;case R.SET_TITLE:n.setTitle(e.params);break;case R.AUTH_BY_EXCHANGE_TOKEN:n.onAuthByExchangeToken();break;case R.FORCE_LOGOUT:n.onForceLogout();break;case L.SUPERAPP_TOKEN:q._requestSuperAppToken(e.params);break;case L.AUTH_NEEDED:q._auth();break;default:n.events.emit(M.MESSAGE,e)}},this.handleResize=function(){if(n.iframe){var e=innerWidth,t=innerHeight;n.iframe.style.height=t+"px",n.iframe.style.minHeight=t+"px",n.bridge.sendMessage({handler:R.RESIZE,params:{viewport_width:e,viewport_height:t}})}},this.handleUpdateConfig=function(){n.bridge.sendMessage({handler:R.APP_INIT_CONFIG,params:{fullMode:n.params.fullMode,hideMenu:n.params.hideMenu}})},this.getMiniAppUrl=function(e,t){var r=q.get(),o=r.connectDomain,i=r.appId,a=r.superAppToken,s=r._debug;return"https://"+o+"/mini_app?"+w({app:n.params.app,host_app_id:i,debug:s?"1":"",localhost:s?"1":"",superapp_token:a,app_query:e?JSON.stringify(e):"",app_hash:t||""})},this.resolveReadyPromise=function(){n.readyPromise&&n.readyPromiseResolve&&(n.readyPromiseResolve(),n.readyPromise=null,n.readyPromiseResolve=null)},this.openMiniapp=function(t){n.child=new e({app:t.app_id,stackMode:n.params.stackMode}),n.events.emit(M.CREATE_APP,{app:n.child,location:t.location})},this.openPayForm=function(t){var r=V({},t.params);r.data&&(r.data=JSON.stringify(r.data));var o=V(V({},r),{app_id:t.app_id,action:t.action}),i=new e({app:6217559,stackMode:n.params.stackMode});i.open(o).then((function(){return n.hide()})).catch(console.error),i.events.on(M.MESSAGE,(function(e){n.handleVKPayFormMessage(e),i.close(),n.show()})),i.events.on(M.HIDE,(function(){i.close(),n.close()}))},this.setTitle=function(e){window.document.title=e.title},this.onAuthByExchangeToken=function(){n.close({closedByExchangeToken:!0})},this.onForceLogout=function(){n.close({closedByForceLogout:!0})},this.handleVKPayFormMessage=function(e){e.handler===R.ACTION_DONE&&n.sendMessage(e)},this.params=V(V({},t),{app:"number"==typeof t.app?"app"+t.app:t.app}),this.events=H()},Q=(function(){function e(){this.stack=[]}e.prototype.removeMiniApp=function(e){var t=e.app,n=this.stack.lastIndexOf(t);if(n>-1&&n===this.stack.length-1)if(this.stack.splice(n,1),this.stack.length){this.stack[this.stack.length-1].show();var r=this.stack[this.stack.length-2];setTimeout((function(){return null==r?void 0:r.hide()}),0)}else x.restoreBodyOverflow()},e.prototype.makeHandleMiniAppClose=function(e){var t=this,n=e.app;return function(){t.removeMiniApp({app:n})}},e.prototype.makeHandleMiniAppHide=function(e){var t=this,n=e.app;return function(){var e=t.stack.lastIndexOf(n);e>-1&&e===t.stack.length-1&&setTimeout((function(){return n.close()}),0)}},e.prototype.handleMiniAppCreate=function(e){var t=e.app,n=e.query,r=e.hash;this.stack.push(t),t.open(n,r).catch(console.error),t.events.on(M.CREATE_APP,this.handleMiniAppCreate.bind(this)),t.events.on(M.HIDE,this.makeHandleMiniAppHide({app:t})),t.events.on(M.CLOSE,this.makeHandleMiniAppClose({app:t})),x.freezeBodyOverflow();var o=this.stack[this.stack.length-2];return setTimeout((function(){null==o||o.hide()}),0),t},Object.defineProperty(e.prototype,"length",{get:function(){return this.stack.length},enumerable:!1,configurable:!0}),e.prototype.open=function(e){var t=e.app,n=e.query,r=e.hash,o=new Y({app:t,stackMode:!0});return this.handleMiniAppCreate({app:o,query:n,hash:r}),o},e.prototype.close=function(){var e=this.stack;this.stack.splice(0),e.reverse().forEach((function(e){return e.close()})),x.restoreBodyOverflow()}}(),"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"),X=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21,t="",n=e;n--;)t+=Q[64*Math.random()|0];return t};!function(e){e.STATIC_MAP="VKSDKRequestToGeoservice:staticmap/png/",e.SEARCH="VKSDKRequestToGeoservice:search",e.OVERALL="VKSDKRequestToGeoservice:overall",e.DIRECTIONS="VKSDKRequestToGeoservice:directions",e.ISO="VKSDKRequestToGeoservice:iso"}(K||(K={}));!function(){function e(e){var t=this;this.apiKey=e.apiKey;var n=document.createElement("iframe"),r=q.get().appId;n.src=this.getGeoserviceProxyUrl({app_id:r}),n.style.cssText="\n      display: none;\n    ",this.iframe=n,document.body.appendChild(this.iframe),this.bridge=new $({iframe:this.iframe,origin:"https://"+q.get().connectDomain}),this.requestMap={},this.bridge.onMessage((function(e){var n=e.params,r=n.requestID,o=n.response;t.requestMap[r].resolve(o),delete t.requestMap[r]}))}e.prototype.setApiKey=function(e){this.apiKey=e},e.prototype.getGeoserviceProxyUrl=function(e){var t=q.get(),n=t.connectDomain,r=t._debug;return"https://"+n+"/geoservice?"+w(V(V({},e||{}),{origin:location.protocol+"//"+location.host,localhost:String(location.host.includes("localhost")),debug:location.host.includes("localhost")?1:String(r)}))},e.prototype.prepareAnswer=function(e,t,n){var r=this,o=X();return this.bridge.sendMessage({handler:"VKSDKRequestToGeoservice:"+e,params:V(V({},t),{api_key:this.apiKey,wrapRequestInJSON:n,requestID:o})}),new Promise((function(e,t){r.requestMap[o]={resolve:e,reject:t}}))},e.prototype.getStaticMap=function(e){return this.prepareAnswer("staticmap/png/",e)},e.prototype.encodeCoords=function(e){return this.prepareAnswer("search",e)},e.prototype.decodeCoords=function(e){return this.prepareAnswer("overall",e)},e.prototype.getDirections=function(e){return this.prepareAnswer("directions",e,!0)},e.prototype.getISO=function(e){return this.prepareAnswer("iso",e,!0)}}();var J=["extend_token","login_with_user","login_silent_user","__sferum_invite_link","registration_with_phone","registration_with_email","validate_phone","bind_ok_account","no_password_flow"];function Z(e){return e&&J.includes(e.name)?btoa(JSON.stringify(e)):""}function ee(e,t){void 0===t&&(t="auth");var n=q.get(),r=n.appId,o=n.connectDomain,i=n.appSettings,a=V({app_id:r,response_type:"silent_token",v:"1.44.0"},e);return i&&C(i)&&(a.app_settings=S(i)),"https://"+o+"/"+t+"?"+w(a)}var te,ne=[0,1,3,4,6,15,16,82];!function(e){e.Default="default",e.NamePhone="name_phone",e.PhoneName="phone_name"}(te||(te={}));var re,oe=[te.Default,te.NamePhone,te.PhoneName];!function(e){e.Primary="primary",e.Flat="flat"}(re||(re={}));var ie,ae,se,ce,le,ue,de,_e=[re.Primary,re.Flat];!function(e){e.SHOW_DATA_POLICY="VKSDKOneTapAuthConnectDataPolicy",e.HIDE_DATA_POLICY="VKSDKOneTapAuthDataPolicyClose",e.DATA_POLICY_RESULT="VKSDKOneTapAuthDataPolicyResult",e.SHOW_CAPTCHA="VKSDKOneTapAuthDataPolicyShowCaptcha"}(ie||(ie={})),function(e){e.SHOW_POLICY_AGREEMENTS="VKSDKOneTapAuthPolicyAgreementsShow",e.HIDE_POLICY_AGREEMENTS="VKSDKOneTapAuthPolicyAgreementsHide",e.ACCEPT_POLICY_AGREEMENTS="VKSDKOneTapAuthPolicyAgreementsAccept",e.DECLINE_POLICY_AGREEMENTS="VKSDKOneTapAuthPolicyAgreementsDecline",e.POLICY_AGREEMENTS_ERROR="VKSDKOneTapAuthPolicyAgreementsError",e.SHOW_DATA_POLICY="VKSDKOneTapAuthPolicyAgreementsShowDataPolicy"}(ae||(ae={})),function(e){e.CAPTCHA_SUCCESS="VKSDKAuthCaptchaSuccess",e.CAPTCHA_FAIL="VKSDKAuthCaptchaFail"}(se||(se={})),function(e){e.PHONE_VALIDATION_NEEDED="VKSDKOneTapAuthPhoneValidationNeeded",e.FULL_AUTH_NEEDED="VKSDKOneTapAuthFullAuthNeeded",e.AUTH_DATA_LOADED="VKSDKOneTapAuthDataLoaded",e.NOT_AUTHORIZED="VKSDKOneTapAuthNotAuthorized",e.LOGIN_SUCCESS="VKSDKOneTapAuthLoginSuccess",e.RESIZE_FRAME="VKSDKOneTapResizeFrame",e.SHOW_CAPTCHA="VKSDKOneTapShowCaptcha",e.VALIDATE_CAPTCHA="VKSDKOneTapValidateCaptcha"}(ce||(ce={})),function(e){e.CLOSE_AUTH="VKSDKOneTapAuthClose",e.ADAPTIVITY_CHANGE="VKSDKFloatingOneTapAdaptivityChange",e.ADAPTIVITY_CHANGED="VKSDKFloatingOneTapAdaptivityChanged"}(le||(le={})),function(e){e.SHOW_LOGIN="VKSDKButtonOneTapAuthShowLogin",e.SHOW_LOGIN_OPTIONS="VKSDKButtonOneTapAuthShowLoginOptions",e.SHOW_AGREEMENTS_DIALOG="VKSDKButtonOneTapAuthShowAgreementsDialog",e.START_AUTHORIZE="VKSDKButtonOneTapAuthStartAuthorize"}(ue||(ue={})),function(e){e.WRONG_TOKEN="VKSDKBindAccountErrorWrongToken",e.ALREADY_BIND="VKSDKBindAccountErrorAlreadyBind"}(de||(de={}));var pe,he,fe=function(){function e(){}return e.flags=null,e.silentAuth=function(){var e=q.get(),t="https://"+e.loginDomain+"/?act=connect&app_id="+e.appId+"&response_type=silent_token&uuid="+X()+"&v=1.44.0",n=new XMLHttpRequest;return n.open("GET",t,!0),n.responseType="json",n.withCredentials=!0,new Promise((function(e,t){n.onload=function(){n.response?e({provider:"vk",payload:n.response}):t()},n.onerror=function(){t()},n.send()}))},e.oneTapAuth=function(t,n){if(console.warn("Connect.oneTapAuth method is deprecated. Use Connect.floatingOneTapAuth and Connect.buttonOneTapAuth methods."),!["floating","button"].includes(t))return null;switch(t){case"button":return e.buttonOneTapAuth(n);case"floating":return e.floatingOneTapAuth(n);default:return null}},e.floatingOneTapAuth=function(t){var n=function(){var e,t=window.innerWidth,n=t<=768;return{destroy:function(){return window.removeEventListener("resize",e)},isAdaptive:function(){return n},observe:function(r){e=function(){var e=window.innerWidth;t>768&&e<=768?r(n=!0):t<=768&&e>768&&r(n=!1),t=e},window.addEventListener("resize",e)}}}(),r=function(e,t){var n,r,o,i={},a=e?"314px":"334px",s=e?"\n      display: none;\n      position: fixed;\n      bottom: 0;\n      right: 50%;\n      transform: translate(50%, 0);\n      max-width: 468px;\n      width: 100%;\n      height: "+a+";\n    ":"\n        display: none;\n        position: fixed;\n        top: 0;\n        right: 0;\n        max-width: 400px;\n        width: 100%;\n        height: "+a+";\n      ";return(null===(n=null==t?void 0:t.styles)||void 0===n?void 0:n.zIndex)&&isFinite(null===(r=null==t?void 0:t.styles)||void 0===r?void 0:r.zIndex)&&(s+="z-index: "+(null===(o=null==t?void 0:t.styles)||void 0===o?void 0:o.zIndex)+";"),t&&(i.skip_success=P(t.skipSuccess,0)),{pageUrl:"floating_one_tap_auth",pageUrlParams:V({adaptive:e?1:0},i),frameStyles:s}}(n.isAdaptive(),t.options);if(!r)throw new Error("options were not set");var o=X(),i=T(ee(V({origin:location.protocol+"//"+location.host,uuid:o},r.pageUrlParams),r.pageUrl),{cssText:r.frameStyles}),a=new $({iframe:i,origin:"https://"+q.get().connectDomain});n.observe((function(e){a.sendMessage({handler:le.ADAPTIVITY_CHANGE,params:{uuid:o,is_adaptive:e}}),e?(i.style.maxWidth="468px",i.style.top="auto",i.style.bottom="0",i.style.right="50%",i.style.transform="translate(50%, 0)"):(i.style.maxWidth="400px",i.style.top="0",i.style.bottom="auto",i.style.right="0",i.style.transform="none"),i.style.display="none"})),document.body.appendChild(i);var s=function(){a.sendMessage({handler:ce.RESIZE_FRAME,params:{uuid:o}})};window.addEventListener("resize",s);var c=function(){i&&(i.remove(),i=null),window.removeEventListener("resize",s),n&&n.destroy(),a.destroy()},l=new Promise((function(n){a.onMessage((function(r){if(r.params.uuid===o)switch(r.handler){case ce.NOT_AUTHORIZED:t.callback({type:r.handler,payload:{uuid:o,error:"not_authorized"}}),c(),n(r.handler);break;case ce.RESIZE_FRAME:i.style.height=r.params.height+"px";break;case le.CLOSE_AUTH:t.callback({type:r.handler,payload:{uuid:o}}),c();break;case le.ADAPTIVITY_CHANGED:i.style.display="block";break;case ce.AUTH_DATA_LOADED:i.style.display="block",n(r.handler);default:e.handleOneTapEvents(r,a,t)}}))}));return{getFrame:function(){return i},destroy:c,authReadyPromise:l}},e.buttonOneTapAuth=function(t){var n=function(e){var t,n,r,o,i,a,s={},c=44,l=56;return e&&(s.display=e.displayMode&&oe.includes(e.displayMode)?e.displayMode:te.Default,s.button_skin=e.buttonSkin&&_e.includes(e.buttonSkin)?e.buttonSkin:re.Primary,s.show_agreements=P(e.showAgreements,0),s.show_alternative_login=P(e.showAlternativeLogin,0),s.show_agreements_dialog=P(e.showAgreementsDialog,1),void 0!==(null===(t=e.buttonStyles)||void 0===t?void 0:t.height)&&(c=Number(null===(n=e.buttonStyles)||void 0===n?void 0:n.height),l=Number(null===(r=e.buttonStyles)||void 0===r?void 0:r.height)+12,s.style_height=null===(o=e.buttonStyles)||void 0===o?void 0:o.height),void 0!==(null===(i=e.buttonStyles)||void 0===i?void 0:i.borderRadius)&&(s.style_border_radius=null===(a=e.buttonStyles)||void 0===a?void 0:a.borderRadius),void 0!==e.langId&&(s.lang_id=ne.includes(e.langId)?e.langId:0),c+=s.show_alternative_login?l:0,c+=s.show_agreements?80:0),{pageUrl:"button_one_tap_auth",pageUrlParams:s,frameStyles:"\n        height: "+c+"px;\n      "}}(t.options);if(!n)throw new Error("options were not set");var r=X(),o=T(ee(V({origin:location.protocol+"//"+location.host,uuid:r},n.pageUrlParams),n.pageUrl),{cssText:n.frameStyles}),i=t.container;i&&i.appendChild(o);var a=new $({iframe:o,origin:"https://"+q.get().connectDomain}),s=function(){a.sendMessage({handler:ce.RESIZE_FRAME,params:{uuid:r}})};return window.addEventListener("resize",s),{getFrame:function(){return o},destroy:function(){o&&(o.remove(),o=null),window.removeEventListener("resize",s),a.destroy()},authReadyPromise:new Promise((function(n){a.onMessage((function(i){if(i.params.uuid===r)switch(i.handler){case ce.RESIZE_FRAME:o.style.height=i.params.height+"px";break;case ce.NOT_AUTHORIZED:n(i.handler);break;case ue.SHOW_LOGIN:case ue.SHOW_LOGIN_OPTIONS:t.callback({type:i.handler,payload:{uuid:r}});break;case ue.SHOW_AGREEMENTS_DIALOG:e.userPolicyAgreements(r).show().then((function(e){e&&e.accepted&&a.sendMessage({handler:ue.START_AUTHORIZE,params:{uuid:r}})})).catch((function(){a.sendMessage({handler:ae.DECLINE_POLICY_AGREEMENTS,params:{uuid:r}})}));break;case ce.AUTH_DATA_LOADED:n(i.handler);default:e.handleOneTapEvents(i,a,t)}}))}))}},e.handleOneTapEvents=function(t,n,r){var o=t.params.uuid;switch(t.handler){case ce.AUTH_DATA_LOADED:n.sendMessage({handler:ce.RESIZE_FRAME,params:{uuid:o}});break;case ce.LOGIN_SUCCESS:r.callback({type:t.handler,provider:"vk",payload:t.params});break;case ce.SHOW_CAPTCHA:var i=e.captcha(o,{captcha_sid:t.params.captcha_sid,captcha_img:t.params.captcha_img});i.show().then((function(e){n.sendMessage({handler:se.CAPTCHA_SUCCESS,params:V({uuid:o},e)})})).catch((function(){n.sendMessage({handler:se.CAPTCHA_FAIL,params:{uuid:o}}),i.destroy()}));break;case ie.SHOW_DATA_POLICY:e.userDataPolicy(o).show().then((function(){r.callback({type:ie.DATA_POLICY_RESULT,payload:{uuid:o,policyAccepted:!0}})})).catch((function(){r.callback({type:ie.DATA_POLICY_RESULT,payload:{uuid:o,policyAccepted:!1}})}));break;case ce.FULL_AUTH_NEEDED:case ce.PHONE_VALIDATION_NEEDED:r.callback({type:t.handler,payload:{uuid:o}})}},e.userDataPolicy=function(t){var n=ee({origin:location.protocol+"//"+location.host,uuid:t},"user_data_policy"),r=window.innerHeight,o=T(n,{properties:{height:r+"px"},cssText:"\n      display: none;\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: "+r+"px;\n      min-height: "+r+"px;\n      border: none;\n      z-index: 99999;\n    "});document.body.appendChild(o);var i=new $({iframe:o,origin:"https://"+q.get().connectDomain}),a=function(){o.style.display="none"};return{show:function(){return o.style.display="block",new Promise((function(n,r){i.onMessage((function(s){switch(s.handler){case ie.HIDE_DATA_POLICY:a(),n(void 0);break;case ie.SHOW_CAPTCHA:var c=e.captcha(t,{captcha_sid:s.params.captcha_sid,captcha_img:s.params.captcha_img});c.show().then((function(e){i.sendMessage({handler:se.CAPTCHA_SUCCESS,params:V({uuid:t},e)}),o.style.display="block"})).catch((function(){i.sendMessage({handler:se.CAPTCHA_FAIL,params:{uuid:t}}),c.destroy()})),a();break;default:a(),r()}}))}))},hide:a,destroy:function(){document.body.removeChild(o),i.destroy()}}},e.userPolicyAgreements=function(t){var n,r=T(ee({origin:location.protocol+"//"+location.host,uuid:t},"user_policy_agreements"),{properties:{height:(n=window.innerHeight)+"px"},cssText:"\n      display: none;\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: "+n+"px;\n      min-height: "+n+"px;\n      border: none;\n      z-index: 99999;\n    "});document.body.appendChild(r);var o=new $({iframe:r,origin:"https://"+q.get().connectDomain}),i=function(){r.style.display="none"};return{show:function(){return r.style.display="block",new Promise((function(n,a){o.onMessage((function(o){switch(o.handler){case ae.ACCEPT_POLICY_AGREEMENTS:i(),n({accepted:!0});break;case ae.DECLINE_POLICY_AGREEMENTS:i(),n({accepted:!1});break;case ae.SHOW_DATA_POLICY:i();var s=function(){r.style.display="block"};e.userDataPolicy(t).show().then(s).catch(s);break;case ae.POLICY_AGREEMENTS_ERROR:case ae.HIDE_POLICY_AGREEMENTS:default:i(),a()}}))}))},hide:i,destroy:function(){document.body.removeChild(r),o.destroy()}}},e.captcha=function(e,t){var n=ee(V({origin:location.protocol+"//"+location.host,uuid:e},t),"auth_captcha"),r=window.innerHeight,o=T(n,{cssText:"\n      display: none;\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: "+r+"px;\n      min-height: "+r+"px;\n      border: none;\n      z-index: 99999;\n    "});document.body.appendChild(o);var i=new $({iframe:o,origin:"https://"+q.get().connectDomain}),a=function(){document.body.removeChild(o),i.destroy()};return{show:function(){return o.style.display="block",new Promise((function(e,t){i.onMessage((function(n){if(n.handler===se.CAPTCHA_SUCCESS)e(n.params),a();else t(),a()}))}))},destroy:a}},e.userVisibleAuth=function(t){var n=X(),r=q.get(),o=V({origin:location.protocol+"//"+location.host,uuid:n,debug:P(r._debug,0),localhost:P(r._debug,0)},A(t,["screen","source"])),i=Z(null==t?void 0:t.action);i&&(o.action=i);var a=ee(o);e.flags&&(a=a+"#"+w(e.flags));var s=screen.height/2-280,c=screen.width/2-410,l=window.open(a,"_blank","top="+s+",left="+c+",width=820,height=560,location");if(!l){var u={code:O.CONNECT_WINDOW_NOT_OPENED,reason:"Connect window was not opened."};return Promise.reject(u)}return new Promise((function(e,t){var r=setInterval((function(){if(!l||l.closed){window.removeEventListener("message",o),clearInterval(r);var e={code:O.CONNECT_WINDOW_CLOSED,reason:"Connect window was closed."};t(e)}}),1e3);function o(i){if(i.source===l&&l)if(window.removeEventListener("message",o),clearInterval(r),".vk.com"===i.origin.slice(i.origin.length-".vk.com".length))if(i.data.action==="vk_connect_response"+n){var a=i.data.payload;l.close(),a.error?(c={code:O.CONNECT_CLIENT_SDK_ERROR,reason:W(a.error)},t(c)):e({provider:"vk",payload:a})}else if(i.data.action==="oauth_callback"+n)e({provider:i.data.payload.name}),l.close();else if(i.data.action==="skip_callback"+n){var s=i.data.payload.redirectURL;s&&(window.location.href=s),l.close()}else i.data.action==="bind_ok_account"+n?(e(i.data.payload),l.close()):(l.close(),c={code:O.CONNECT_UNKNOWN_SDK_MESSAGE,reason:F(JSON.stringify(i.data))},t(c));else{l.close();var c={code:O.CONNECT_DOMAIN_NOT_ALLOWED,reason:U(i.origin)};t(c)}}window.addEventListener("message",o)}))},e.redirectAuth=function(e){var t=X(),n=V({redirect_uri:e.url,uuid:t},A(e,["screen","source"])),r=Z(null==e?void 0:e.action);r&&(n.action=r),(null==e?void 0:e.state)&&(n.redirect_state=e.state);var o=ee(n);location.assign(o)},e.logout=function(){var e=q.get(),t=e.connectDomain,n=e.appId,r=e.superAppTokenV2;if(!r)return Promise.reject(B("superappToken","SuperappToken is undefined"));var o=w({origin:location.protocol+"//"+location.host,host_app_id:n,superapp_token:r}),i=fetch("https://"+t+"/logout?"+o,{credentials:"include"});return q.events.emit(k.LOGOUT),q.setSuperAppToken(""),q.setSuperAppToken("",{version:2}),i},e}(),me=["open_account"];!function(){function e(){}e.open=function(e){var t,n=X(),r=q.get(),o=V({origin:location.protocol+"//"+location.host,uuid:n,debug:P(r._debug,0),localhost:P(r._localhost,0)},A(e,["screen","source"])),i=(t=null==e?void 0:e.action)&&me.includes(t.name)?btoa(JSON.stringify(t)):"";i&&(o.action=i);var a=function(e){var t=q.get(),n=t.appId,r=t.connectDomain,o=t.appSettings,i=V({app_id:n,response_type:"silent_token",v:"1.44.0"},e);return o&&C(o)&&(i.app_settings=S(o)),"https://"+r+"/open_account?"+w(i)}(o);if(!window.open(a,"_blank")){var s={code:O.CONNECT_WINDOW_NOT_OPENED,reason:"Connect window was not opened."};return Promise.reject(s)}return Promise.resolve()}}();!function(e){e.INTERNAL_RESIZE="VKSDKMessengerInternalResize",e.INTERNAL_LOGOUT="VKSDKMessengerInternalLogout"}(pe||(pe={})),function(e){e.CLOSE_CHAT="VKSDKMessengerCloseChat"}(he||(he={}));var ge=function(){function e(){var e=this;this.resolve=function(t){if(Boolean(e.promise))return e.finished=!0,e.active=!1,e.resolveHandler(t)},this.reject=function(t){if(Boolean(e.promise))return e.finished=!0,e.active=!1,e.rejectHandler(t)}}return e.prototype.start=function(){var e=this;this.active=!0,this.finished=!1,this.promise=new Promise((function(t,n){e.resolveHandler=t,e.rejectHandler=n}))},e.prototype.get=function(){return this.promise},e}(),ve=function(){function e(){}return e.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}(),ye=function(){function e(){var e=this;this.config={},this.params={},this.loadingTask=new ge,this.initTask=new ge,this.cssText="",this.handleError=function(t){var n={data:t,code:O.CUSTOM};e.events.emit(k.ERROR,n)},this.events=H(),this.handleBridgeMessage=this.handleBridgeMessage.bind(this),this.handleChangeSuperAppToken=this.handleChangeSuperAppToken.bind(this),this.close=this.close.bind(this),this.handleLogout=this.handleLogout.bind(this)}return e.prototype.preload=function(e){var t=this;return this.validateParams(e).then((function(){return t.updateParams(e),t.createIframe(),t.initTask.start(),t.loadingTask.start(),t.timeoutTimer=setTimeout((function(){if(!t.initTask.finished){var e={code:O.LOADING_ERROR,reason:"Loading timeout"};t.initTask.reject(e)}}),5e3),t.iframe.onload=function(){t.iframe.onload=null,t.loadingTask.resolve()},t.bridge=new $({iframe:t.iframe,origin:"https://"+q.get().connectDomain}),t.bridge.onMessage(t.handleBridgeMessage),q.events.on(N.SUPERAPP_TOKEN_CHANGE_V2,t.handleChangeSuperAppToken),q.events.on(k.LOGOUT,t.close),window.document.body.appendChild(t.iframe),t.loadingTask.get()}))},e.prototype.open=function(e){var t=this;return this.validateParams(e).then((function(){return t.initTask.finished?(t.updateParams(e),Promise.resolve()):t.initTask.active||t.initTask.finished?(t.updateParams(e),t.initTask.get()):t.preload(e).then((function(){return t.initTask.get()}))}))},e.prototype.update=function(e,t){e&&this.updateParams(e),t&&this.updateConfig(t)},e.prototype.close=function(){this.iframe&&this.iframe.remove(),this.bridge&&this.bridge.destroy(),q.events.off(N.SUPERAPP_TOKEN_CHANGE_V2,this.handleChangeSuperAppToken),q.events.off(k.LOGOUT,this.close),delete this.iframe,delete this.bridge,this.loadingTask=new ge,this.initTask=new ge,this.events.emit(k.CLOSE)},e.prototype.sendMessage=function(e){this.bridge.sendMessage(e)},e.prototype.on=function(e,t){this.events.on(e,t)},e.prototype.off=function(e,t){this.events.off(e,t)},e.prototype.handleInit=function(){this.initTask.finished||(clearTimeout(this.timeoutTimer),this.initTask.resolve()),this.sendUpdateParamsMessage(),this.iframe.style.display="block"},e.prototype.handleRequestAuth=function(){q._auth({version:2})},e.prototype.handleRequestSuperAppToken=function(e){q._requestSuperAppToken(e,{version:2})},e.prototype.handleChangeSuperAppToken=function(e){this.bridge.sendMessage({handler:k.REQUEST_SUPERAPP_TOKEN+"Success",params:{result:e}})},e.prototype.handleBridgeMessage=function(e){switch(ve.log(e),e.handler){case I.INIT:this.handleInit();break;case k.REQUEST_SUPERAPP_TOKEN:this.handleRequestSuperAppToken(e.params);break;case k.AUTH_NEEDED:this.handleRequestAuth();break;case k.CLOSE:this.close();break;case k.ERROR:this.handleError(e.params);break;default:return}},e.prototype.handleLogout=function(){q._logout()},e.prototype.handleAfterUpdateParams=function(){this.sendUpdateParamsMessage()},e.prototype.handleAfterUpdateConfig=function(){},e.prototype.handleAfterCreateIframe=function(){},e.prototype.validateParams=function(e){return Promise.resolve(e)},e.prototype.createIframe=function(){var e=this.getIframeUrl();this.iframe=T(e,{cssText:this.cssText}),this.handleAfterCreateIframe()},e.prototype.getIframeUrl=function(){return""},e.prototype.getIframeUrlParams=function(){var e=q.get(),t=e._debug,n=e.superAppTokenV2,r=e.appId;return w(V(V({},this.params),{host_app_id:r,superapp_token:n,debug:P(t,0),localhost:P(t,0),origin:location.protocol+"//"+location.host}))},e.prototype.updateConfig=function(e){this.config=D(this.config,e),this.handleAfterUpdateConfig()},e.prototype.updateParams=function(e){this.params=D(this.params,e||{}),this.handleAfterUpdateParams()},e.prototype.sendUpdateParamsMessage=function(){this.bridge&&this.initTask.finished&&this.bridge.sendMessage({params:this.params,handler:k.UPDATE_PARAMS})},e}(),Ee={styles:{bottom:"0",right:"0",zIndex:99999}};!function(e){function t(t){var n=e.call(this)||this;return n.config=Ee,n.cssText="\n    border: none;\n    display: none;\n    position: fixed;\n  ",n.updateStyles=function(){if(n.iframe){var e=n.config.styles,t=isFinite(e.zIndex)?e.zIndex:999999;n.iframe.style.zIndex=""+t,n.iframe.style.bottom=e.bottom,n.iframe.style.right=e.right}},n.createCaptcha=function(e,t){var n=ee(V({origin:location.protocol+"//"+location.host,uuid:e},t),"auth_captcha"),r=window.innerHeight,o=T(n,{cssText:"\n      display: none;\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: "+r+"px;\n      min-height: "+r+"px;\n      border: none;\n      z-index: 99999;\n    "});document.body.appendChild(o);var i=new $({iframe:o,origin:"https://"+q.get().connectDomain}),a=function(){document.body.removeChild(o),i.destroy()};return{show:function(){return o.style.display="block",new Promise((function(e,t){i.onMessage((function(n){if(n.handler===se.CAPTCHA_SUCCESS)e(n.params),a();else t(),a()}))}))},destroy:a}},n.updateConfig(t),n}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),t.prototype.handleBridgeMessage=function(t){var n=this;switch(e.prototype.handleBridgeMessage.call(this,t),t.handler){case k.GET_CAPTCHA:var r=t.params.uuid,o=this.createCaptcha(r,{captcha_sid:t.params.captcha_sid,captcha_img:t.params.captcha_img});o.show().then((function(e){n.bridge.sendMessage({handler:k.GET_CAPTCHA+"Success",params:V({uuid:r},e)})})).catch((function(){n.bridge.sendMessage({handler:k.GET_CAPTCHA+"Fail",params:{uuid:r}}),o.destroy()}));break;case pe.INTERNAL_RESIZE:this.handleInternalIframeResize(t);break;case pe.INTERNAL_LOGOUT:this.handleLogout();break;case he.CLOSE_CHAT:this.events.emit(he.CLOSE_CHAT,t.params);break;default:return}},t.prototype.handleInternalIframeResize=function(e){var t=e.params;this.iframe.width=t.width+"px",this.iframe.height=t.height+"px"},t.prototype.handleAfterUpdateConfig=function(){this.updateStyles()},t.prototype.handleAfterCreateIframe=function(){this.updateStyles()},t.prototype.validateParams=function(e){return e.peer_id>=0?Promise.reject(B("peer_id","Peer id can`t be positive")):Promise.resolve(e)},t.prototype.getIframeUrl=function(){return"https://"+q.get().connectDomain+"/messenger?"+this.getIframeUrlParams()}}(ye)},76624:function(e){e.exports=function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)},t=1,n=7,r=96*t,o=96*t,i=25,a=function(e,t,r,o,a){if(e<n&&t<n)return!1;if(e>=r-n&&t<n)return!1;if(e<n&&t>=r-n)return!1;if(a){var s=n+2;r<=i&&s--;var c=(r-2*n-s)/2-1;return r<=i&&c++,!(e>n+c&&e<r-n-c-1&&t>n+c&&t<r-n-c-1)&&0<=e&&e<r&&0<=t&&t<r&&o[t][e]}return o[t]&&o[t][e]},s=function(e,t,n,r,o){return void 0===o&&(o=!0),{l:a(e-1,t,n,r,o),r:a(e+1,t,n,r,o),t:a(e,t-1,n,r,o),b:a(e,t+1,n,r,o),current:a(e,t,n,r,o)}},c=function(e,c){if("number"!=typeof c.qrSize)throw new Error("Size should be a number");if("string"!=typeof c.className)throw new Error("Classname should be a string");for(var l=2*t,u=12.7*t,d=12.8*t,_=14.7*t,p=14.8*t,h=15.9*t,f=28.6*t,m=30.5*t,g=84.7776815*t,v=87.3*t,y=71.4*t,E=42.9*t,w=87.2*t,b=85.2*t,C=85.3*t,S=69.5*t,T=98*t,D=100*t,P=[],A=0,k=0,I=0,O=0,x=0;x<e.size;x++){A=0;for(var R=0;R<e.size;R++){I=R+A,A+=r,O=x+k;var M=s(R,x,e.size,e.modules,c.isShowLogo),L="",N="";M.current?(N=!(N=N||M.l||M.r||M.t||M.b?"":"empty")&&M.l&&M.r||M.t&&M.b?"rect":"")||(N+=M.l?"l":M.r?"r":"",(N+=M.t?"t":M.b?"b":"")||(N="empty")):N=!(N=!(N=!(N=!N&&M.l&&M.t&&a(R-1,x-1,e.size,e.modules,c.isShowLogo)?"n_lt":"")&&M.l&&M.b&&a(R-1,x+1,e.size,e.modules,c.isShowLogo)?"n_lb":"")&&M.r&&M.t&&a(R+1,x-1,e.size,e.modules,c.isShowLogo)?"n_rt":"")&&M.r&&M.b&&a(R+1,x+1,e.size,e.modules,c.isShowLogo)?"n_rb":"",N&&(L='<use xlink:href="#'+N+"-"+c.suffix+'"/>',P.push('<g transform="translate('+I+","+O+')">'+L+"</g>"))}k+=r}var B="",U=(e.size-3*n)/2*r+r*n-10;e.size<=i&&(B="scale(0.85)",U+=50);var F=(e.size-n)*o;P.push('<use fill-rule="evenodd" transform="translate(0,0)" xlink:href="#point-'+c.suffix+'"/>'),P.push('<use fill-rule="evenodd" transform="translate('+F+',0)" xlink:href="#point-'+c.suffix+'"/>'),P.push('<use fill-rule="evenodd" transform="translate(0,'+F+')" xlink:href="#point-'+c.suffix+'"/>'),c.isShowLogo&&(c.logoData?P.push('\n        <image\n          preserveAspectRatio="xMidYMid slice" clip-path="url(#logo-mask-'+c.suffix+')"\n          style="width: 750px; height: 750px;" width="750" height="750"\n          transform="translate('+U+","+U+") "+B+'"\n          xlink:href="'+c.logoData+'"\n        />\n      '):P.push('\n        <use style="width: 750px; height: 750px;" width="750" height="750"\n          fill="none"\n          fill-rule="evenodd"\n          transform="translate('+U+","+U+") "+B+'" xlink:href="#vk_logo-'+c.suffix+'"\n        />\n      '));var W=99*e.size,j="",V="translate(0,0)";if(c.isShowBackground){var H=(c.qrSize-40)/c.qrSize,K=W/c.qrSize*21;j='\n      <rect\n        x="0"\n        width="'+W+'"\n        height="'+W+'"\n        rx="'+Math.ceil(W/(c.qrSize/36))+'"\n        fill="'+c.backgroundColor+'"\n      />',V="translate("+K+", "+K+") scale("+H+")"}var G="M0,0 L66,0 C"+g+",-3.44940413e-15 "+D+",15.2223185 "+D+",34 L"+D+",66 C"+D+","+g+" "+g+","+D+" 66,"+D+" L0,"+D+" L0,0 Z",z="M0,0 L"+D+",0 L"+D+",66 C"+D+","+g+" "+g+","+D+" 66,"+D+" L0,"+D+" L0,0 Z";return'\n  <svg\n    version="1.1"\n    viewBox="0 0 '+W+" "+W+'"\n    width="'+c.qrSize+'px"\n    height="'+c.qrSize+'px"\n    '+(c.className?'class="'+c.className+'"':"")+'\n    xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n  >\n    <defs>\n      <rect id="rect-'+c.suffix+'" width="100" height="100" fill="'+c.foregroundColor+'"/>\n      <path\n        id="empty-'+c.suffix+'"\n        d="M0,'+f+"v"+E+"C0,"+v+","+d+","+D+","+f+","+D+"h"+E+"c"+h+",0,"+f+"-"+d+","+f+"-"+f+"V"+f+"C"+D+","+u+","+w+",0,"+y+",0H"+f+" C"+d+",0,0,"+d+",0,"+f+'z"\n        fill="'+c.foregroundColor+'"\n      />\n      <path id="b-'+c.suffix+'" d="'+G+'" transform="rotate(-90 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="r-'+c.suffix+'" d="'+G+'" transform="rotate(-180 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="l-'+c.suffix+'" d="'+G+'" fill="'+c.foregroundColor+'"/>\n      <path id="t-'+c.suffix+'" d="'+G+'" transform="rotate(90 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="l-'+c.suffix+'" d="'+z+'" transform="rotate(-90 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="lt-'+c.suffix+'" d="'+z+'" fill="'+c.foregroundColor+'"/>\n      <path id="lb-'+c.suffix+'" d="'+z+'" transform="rotate(-90 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="rb-'+c.suffix+'" d="'+z+'" transform="rotate(-180 50 50)" fill="'+c.foregroundColor+'"/>\n      <path id="rt-'+c.suffix+'" d="'+z+'" transform="rotate(90 50 50)" fill="'+c.foregroundColor+'"/>\n      <path\n        id="n_lt-'+c.suffix+'"\n        d="M'+m+","+l+"V0H0v"+m+"h"+l+"C"+l+","+_+","+p+","+l+","+m+","+l+'z"\n        fill="'+c.foregroundColor+'"\n      />\n      <path\n        id="n_lb-'+c.suffix+'"\n        d="M'+l+","+S+"H0V"+D+"h"+m+"v-"+l+"C"+_+","+T+","+l+","+b+","+l+","+S+'z"\n        fill="'+c.foregroundColor+'"\n      />\n      <path\n        id="n_rt-'+c.suffix+'"\n        d="M'+T+","+m+"h"+l+"V0H"+S+"v"+l+"C"+C+","+l+","+T+","+p+","+T+","+m+'z"\n        fill="'+c.foregroundColor+'"\n      />\n      <path id="n_rb-'+c.suffix+'"\n        d="M'+S+","+T+"v"+l+"H"+D+"V"+S+"h-"+l+"C"+T+","+C+","+b+","+T+","+S+","+T+'z"\n        fill="'+c.foregroundColor+'"\n      />\n      <path\n        id="point-'+c.suffix+'"\n        fill="'+c.foregroundColor+'"\n        d="M600.001786,457.329333 L600.001786,242.658167 C600.001786,147.372368 587.039517,124.122784 581.464617,118.535383 C575.877216,112.960483 552.627632,99.9982143 457.329333,99.9982143 L242.670667,99.9982143 C147.372368,99.9982143 124.122784,112.960483 118.547883,118.535383 C112.972983,124.122784 99.9982143,147.372368 99.9982143,242.658167 L99.9982143,457.329333 C99.9982143,552.627632 112.972983,575.877216 118.547883,581.464617 C124.122784,587.027017 147.372368,600.001786 242.670667,600.001786 L457.329333,600.001786 C552.627632,600.001786 575.877216,587.027017 581.464617,581.464617 C587.039517,575.877216 600.001786,552.627632 600.001786,457.329333 Z M457.329333,0 C653.338333,0 700,46.6616668 700,242.658167 C700,438.667167 700,261.332833 700,457.329333 C700,653.338333 653.338333,700 457.329333,700 C261.332833,700 438.667167,700 242.670667,700 C46.6616668,700 0,653.338333 0,457.329333 C0,261.332833 0,352.118712 0,242.658167 C0,46.6616668 46.6616668,0 242.670667,0 C438.667167,0 261.332833,0 457.329333,0 Z M395.996667,200 C480.004166,200 500,220.008332 500,303.990835 C500,387.998334 500,312.001666 500,395.996667 C500,479.991668 480.004166,500 395.996667,500 C312.001666,500 387.998334,500 304.003333,500 C220.008332,500 200,479.991668 200,395.996667 C200,312.001666 200,350.906061 200,303.990835 C200,220.008332 220.008332,200 304.003333,200 C387.998334,200 312.001666,200 395.996667,200 Z"\n      />\n      <g id="vk_logo-'+c.suffix+'">\n        <path\n          fill="'+c.logoColor+'"\n          d="M83.3334 363.333C83.3334 231.34 83.3334 165.343 124.338 124.338C165.343 83.3333 231.34              83.3333 363.333 83.3333H386.667C518.66 83.3333 584.657 83.3333 625.662 124.338C666.667 165.343              666.667 231.34 666.667 363.333V386.667C666.667 518.66 666.667 584.657 625.662 625.662C584.657              666.667 518.66 666.667 386.667 666.667H363.333C231.34 666.667 165.343 666.667 124.338 625.662C83.3334              584.657 83.3334 518.66 83.3334 386.667V363.333Z"\n        />\n        <path\n          fill="#FFF"\n          d="M394.907 508.681C263.293 508.681 183.442 417.365 180.313 265.625H246.972C249.05 377.09              299.763 424.323 338.638 434.036V265.625H402.519V361.82C440.016 357.664 479.264 313.909              492.456 265.625H555.333C545.27 325 502.543 368.754 472.353 386.803C502.566 401.395 551.177              439.593 569.926 508.681H500.815C486.222 462.498 450.476 426.728 402.542 421.872V508.681H394.907Z"\n        />\n      </g>\n      <clipPath id="logo-mask-'+c.suffix+'">\n        <rect x="0" y="0" width="750" height="750" />\n      </clipPath>\n    </defs>\n\n    '+j+'\n\n    <g transform="'+V+'">\n      '+P.join("\n")+"\n    </g>\n  </svg>"},l=function(){function e(t,n,r,o){if(this.version=t,this.errorCorrectionLevel=n,this.mask=o,this.modules=[],this.isFunction=[],t<e.MIN_VERSION||t>e.MAX_VERSION)throw"Version value out of range";if(o<-1||o>7)throw"Mask value out of range";this.size=4*t+17;for(var i=[],a=0;a<this.size;a++)i.push(!1);for(a=0;a<this.size;a++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();var s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){var c=1e9;for(a=0;a<8;a++){this.applyMask(a),this.drawFormatBits(a);var l=this.getPenaltyScore();l<c&&(o=a,c=l),this.applyMask(a)}}if(o<0||o>7)throw"Assertion error";this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}return e.encodeText=function(t,n){var r=d.makeSegments(t);return e.encodeSegments(r,n)},e.encodeBinary=function(t,n){var r=d.makeBytes(t);return e.encodeSegments([r],n)},e.encodeSegments=function(t,n,r,o,i,a){if(void 0===r&&(r=1),void 0===o&&(o=40),void 0===i&&(i=-1),void 0===a&&(a=!0),!(e.MIN_VERSION<=r&&r<=o&&o<=e.MAX_VERSION)||i<-1||i>7)throw"Invalid value";var s,c;for(s=r;;s++){var l=8*e.getNumDataCodewords(s,n),u=d.getTotalBits(t,s);if(u<=l){c=u;break}if(s>=o)throw"Data too long"}for(var _=0,h=[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH];_<h.length;_++){var f=h[_];a&&c<=8*e.getNumDataCodewords(s,f)&&(n=f)}for(var m=new p,g=0,v=t;g<v.length;g++){var y=v[g];m.appendBits(y.mode.modeBits,4),m.appendBits(y.numChars,y.mode.numCharCountBits(s));for(var E=0,w=y.getData();E<w.length;E++){var b=w[E];m.array.push(b)}}if(m.array.length!=c)throw"Assertion error";var C=8*e.getNumDataCodewords(s,n);if(m.array.length>C)throw"Assertion error";if(m.appendBits(0,Math.min(4,C-m.array.length)),m.appendBits(0,(8-m.array.length%8)%8),m.array.length%8!=0)throw"Assertion error";for(var S=236;m.array.length<C;S^=253)m.appendBits(S,8);for(var T=[];8*T.length<m.array.length;)T.push(0);return m.array.forEach((function(e,t){return T[t>>>3]|=e<<7-(7&t)})),new e(s,n,T,i)},e.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},e.prototype.drawCanvas=function(e,t,n){if(e<=0||t<0)throw"Value out of range";var r=(this.size+2*t)*e;n.width=r,n.height=r;for(var o=n.getContext("2d"),i=-t;i<this.size+t;i++)for(var a=-t;a<this.size+t;a++)o.fillStyle=this.getModule(a,i)?"#000000":"#FFFFFF",o.fillRect((a+t)*e,(i+t)*e,e,e)},e.prototype.toSvgString=function(e){if(e<0)throw"Border must be non-negative";for(var t=[],n=0;n<this.size;n++)for(var r=0;r<this.size;r++)this.getModule(r,n)&&t.push("M"+(r+e)+","+(n+e)+"h1v1h-1z");return'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+(this.size+2*e)+" "+(this.size+2*e)+'" stroke="none">\n\t<rect width="100%" height="100%" fill="#FFFFFF"/>\n\t<path d="'+t.join(" ")+'" fill="#000000"/>\n</svg>\n'},e.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);var t=this.getAlignmentPatternPositions(),n=t.length;for(e=0;e<n;e++)for(var r=0;r<n;r++)0==e&&0==r||0==e&&r==n-1||e==n-1&&0==r||this.drawAlignmentPattern(t[e],t[r]);this.drawFormatBits(0),this.drawVersion()},e.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,n=t,r=0;r<10;r++)n=n<<1^1335*(n>>>9);var o=21522^(t<<10|n);if(o>>>15!=0)throw"Assertion error";for(r=0;r<=5;r++)this.setFunctionModule(8,r,u(o,r));for(this.setFunctionModule(8,7,u(o,6)),this.setFunctionModule(8,8,u(o,7)),this.setFunctionModule(7,8,u(o,8)),r=9;r<15;r++)this.setFunctionModule(14-r,8,u(o,r));for(r=0;r<8;r++)this.setFunctionModule(this.size-1-r,8,u(o,r));for(r=8;r<15;r++)this.setFunctionModule(8,this.size-15+r,u(o,r));this.setFunctionModule(8,this.size-8,!0)},e.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^7973*(e>>>11);var n=this.version<<12|e;if(n>>>18!=0)throw"Assertion error";for(t=0;t<18;t++){var r=u(n,t),o=this.size-11+t%3,i=Math.floor(t/3);this.setFunctionModule(o,i,r),this.setFunctionModule(i,o,r)}}},e.prototype.drawFinderPattern=function(e,t){for(var n=-4;n<=4;n++)for(var r=-4;r<=4;r++){var o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}},e.prototype.drawAlignmentPattern=function(e,t){for(var n=-2;n<=2;n++)for(var r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))},e.prototype.setFunctionModule=function(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0},e.prototype.addEccAndInterleave=function(t){var n=this.version,r=this.errorCorrectionLevel;if(t.length!=e.getNumDataCodewords(n,r))throw"Invalid argument";for(var o=e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],i=e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(e.getNumRawDataModules(n)/8),s=o-a%o,c=Math.floor(a/o),l=[],u=new _(i),d=0,p=0;d<o;d++){var h=t.slice(p,p+c-i+(d<s?0:1));p+=h.length;var f=u.getRemainder(h);d<s&&h.push(0),l.push(h.concat(f))}var m=[];for(d=0;d<l[0].length;d++)for(var g=0;g<l.length;g++)(d!=c-i||g>=s)&&m.push(l[g][d]);if(m.length!=a)throw"Assertion error";return m},e.prototype.drawCodewords=function(t){if(t.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw"Invalid argument";for(var n=0,r=this.size-1;r>=1;r-=2){6==r&&(r=5);for(var o=0;o<this.size;o++)for(var i=0;i<2;i++){var a=r-i,s=0==(r+1&2)?this.size-1-o:o;!this.isFunction[s][a]&&n<8*t.length&&(this.modules[s][a]=u(t[n>>>3],7-(7&n)),n++)}}if(n!=8*t.length)throw"Assertion error"},e.prototype.applyMask=function(e){if(e<0||e>7)throw"Mask value out of range";for(var t=0;t<this.size;t++)for(var n=0;n<this.size;n++){var r=void 0;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw"Assertion error"}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}},e.prototype.getPenaltyScore=function(){for(var t=0,n=0;n<this.size;n++){for(var r=[0,0,0,0,0,0,0],o=!1,i=0,a=0;a<this.size;a++)this.modules[n][a]==o?5==++i?t+=e.PENALTY_N1:i>5&&t++:(e.addRunToHistory(i,r),!o&&e.hasFinderLikePattern(r)&&(t+=e.PENALTY_N3),o=this.modules[n][a],i=1);e.addRunToHistory(i,r),o&&e.addRunToHistory(0,r),e.hasFinderLikePattern(r)&&(t+=e.PENALTY_N3)}for(a=0;a<this.size;a++){r=[0,0,0,0,0,0,0],o=!1;var s=0;for(n=0;n<this.size;n++)this.modules[n][a]==o?5==++s?t+=e.PENALTY_N1:s>5&&t++:(e.addRunToHistory(s,r),!o&&e.hasFinderLikePattern(r)&&(t+=e.PENALTY_N3),o=this.modules[n][a],s=1);e.addRunToHistory(s,r),o&&e.addRunToHistory(0,r),e.hasFinderLikePattern(r)&&(t+=e.PENALTY_N3)}for(n=0;n<this.size-1;n++)for(a=0;a<this.size-1;a++)(o=this.modules[n][a])==this.modules[n][a+1]&&o==this.modules[n+1][a]&&o==this.modules[n+1][a+1]&&(t+=e.PENALTY_N2);for(var c=0,l=0,u=this.modules;l<u.length;l++)for(var d=0,_=u[l];d<_.length;d++)(o=_[d])&&c++;var p=this.size*this.size;return t+=(Math.ceil(Math.abs(20*c-10*p)/p)-1)*e.PENALTY_N4},e.prototype.getAlignmentPatternPositions=function(){if(1==this.version)return[];for(var e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((this.size-13)/(2*e-2)),n=[6],r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n},e.getNumRawDataModules=function(t){if(t<e.MIN_VERSION||t>e.MAX_VERSION)throw"Version number out of range";var n=(16*t+128)*t+64;if(t>=2){var r=Math.floor(t/7)+2;n-=(25*r-10)*r-55,t>=7&&(n-=36)}return n},e.getNumDataCodewords=function(t,n){return Math.floor(e.getNumRawDataModules(t)/8)-e.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t]*e.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t]},e.addRunToHistory=function(e,t){t.pop(),t.unshift(e)},e.hasFinderLikePattern=function(e){var t=e[1];return t>0&&e[2]==t&&e[4]==t&&e[5]==t&&e[3]==3*t&&Math.max(e[0],e[6])>=4*t},e.MIN_VERSION=1,e.MAX_VERSION=40,e.PENALTY_N1=3,e.PENALTY_N2=3,e.PENALTY_N3=40,e.PENALTY_N4=10,e.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],e.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e}();function u(e,t){return 0!=(e>>>t&1)}var d=function(){function e(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw"Invalid argument";this.bitData=n.slice()}return e.makeBytes=function(t){for(var n=new p,r=0,o=t;r<o.length;r++){var i=o[r];n.appendBits(i,8)}return new e(e.Mode.BYTE,t.length,n.array)},e.makeNumeric=function(t){if(!this.NUMERIC_REGEX.test(t))throw"String contains non-numeric characters";for(var n=new p,r=0;r<t.length;){var o=Math.min(t.length-r,3);n.appendBits(parseInt(t.substr(r,o),10),3*o+1),r+=o}return new e(e.Mode.NUMERIC,t.length,n.array)},e.makeAlphanumeric=function(t){if(!this.ALPHANUMERIC_REGEX.test(t))throw"String contains unencodable characters in alphanumeric mode";var n,r=new p;for(n=0;n+2<=t.length;n+=2){var o=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));o+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),r.appendBits(o,11)}return n<t.length&&r.appendBits(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6),new e(e.Mode.ALPHANUMERIC,t.length,r.array)},e.makeSegments=function(t){return""==t?[]:this.NUMERIC_REGEX.test(t)?[e.makeNumeric(t)]:this.ALPHANUMERIC_REGEX.test(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]},e.makeEci=function(t){var n=new p;if(t<0)throw"ECI assignment value out of range";if(t<128)n.appendBits(t,8);else if(t<16384)n.appendBits(2,2),n.appendBits(t,14);else{if(!(t<1e6))throw"ECI assignment value out of range";n.appendBits(6,3),n.appendBits(t,21)}return new e(e.Mode.ECI,0,n.array)},e.prototype.getData=function(){return this.bitData.slice()},e.getTotalBits=function(e,t){for(var n=0,r=0,o=e;r<o.length;r++){var i=o[r],a=i.mode.numCharCountBits(t);if(i.numChars>=1<<a)return 1/0;n+=4+a+i.bitData.length}return n},e.toUtf8ByteArray=function(e){e=encodeURI(e);for(var t=[],n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t},e.NUMERIC_REGEX=/^[0-9]*$/,e.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,e.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e}(),_=function(){function e(t){if(this.coefficients=[],t<1||t>255)throw"Degree out of range";for(var n=this.coefficients,r=0;r<t-1;r++)n.push(0);n.push(1);var o=1;for(r=0;r<t;r++){for(var i=0;i<n.length;i++)n[i]=e.multiply(n[i],o),i+1<n.length&&(n[i]^=n[i+1]);o=e.multiply(o,2)}}return e.prototype.getRemainder=function(t){for(var n=this.coefficients.map((function(e){return 0})),r=function(t){var r=t^n.shift();n.push(0),o.coefficients.forEach((function(t,o){return n[o]^=e.multiply(t,r)}))},o=this,i=0,a=t;i<a.length;i++)r(a[i]);return n},e.multiply=function(e,t){if(e>>>8!=0||t>>>8!=0)throw"Byte out of range";for(var n=0,r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;if(n>>>8!=0)throw"Assertion error";return n},e}(),p=function(){function e(){this.array=[]}return e.prototype.appendBits=function(e,t){if(t<0||t>31||e>>>t!=0)throw"Value out of range";for(var n=t-1;n>=0;n--)this.array.push(e>>>n&1)},e}();(function(e){var t=function(){function e(e,t){this.ordinal=e,this.formatBits=t}return e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2),e}();e.Ecc=t})(l||(l={})),function(e){var t=function(){function e(e,t){this.modeBits=e,this.numBitsCharCount=t}return e.prototype.numCharCountBits=function(e){return this.numBitsCharCount[Math.floor((e+7)/17)]},e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]),e}();e.Mode=t}(d||(d={}));var h=128,f="#ffffff",m="#000000",g="#07f";function v(t,n,r,o){if("string"!=typeof t)throw new TypeError("Enter text for encoding");var i=e(e(e({},"object"==typeof n&&null!==n?n:{}),"object"==typeof o&&null!==o?o:{}),{qrSize:"object"==typeof n&&null!==n&&"number"==typeof n.qrSize?n.qrSize:n,className:"object"==typeof n&&null!==n&&"string"==typeof n.className?n.className:r}),a=[l.Ecc.LOW,l.Ecc.MEDIUM,l.Ecc.QUARTILE,l.Ecc.HIGH],s={qrSize:"number"==typeof i.qrSize?i.qrSize:h,className:"string"==typeof i.className?i.className:r||"",isShowLogo:!!i.isShowLogo||!1,isShowBackground:!!i.isShowBackground||!1,foregroundColor:"string"==typeof i.foregroundColor?i.foregroundColor:m,backgroundColor:"string"==typeof i.backgroundColor?i.backgroundColor:f,logoColor:"string"==typeof i.logoColor?i.logoColor:g,suffix:i.suffix?i.suffix.toString():"0",logoData:"string"==typeof i.logoData?i.logoData:null,ecc:"number"==typeof i.ecc&&a[i.ecc]?i.ecc:3},u=d.makeSegments(t),_=l.encodeSegments(u,a[s.ecc],1,40,-1,!0);return c(_,s)}return{createQR:v}}()},89588:(e,t,n)=>{"use strict";t.isIPadOS=t.isIPad=void 0;var r=n(79405);function o(e){e||(e=r.canUseDOM?navigator.userAgent.toLowerCase():"");var t=f(e),n=t||-1!==e.indexOf("ipad"),o=!n&&-1!==e.search(/iphone|ipod/),i=o||n,a=i&&e.match(/OS ([\d_]+) like Mac OS X/i),s=0,c=0;t?(s=13,c=0):a&&(s=+(a=a[1].split("_"))[0],c=+a[1]),a=null;var l=s<13&&!(11===s&&c<3),u=i&&function(e){if(!r.canUseDOM)return!1;var t=window.webkit;if(t&&t.messageHandlers)return!0;var n=/constructor/i.test(String(window.HTMLElement)),o=!!window.indexedDB;if(-1===e.indexOf("safari")||-1===e.indexOf("version")||navigator.standalone){if(!o&&n||!window.statusbar||!window.statusbar.visible);else if(!n||o)return!0}else;return!1}(e),d=!1;return r.canUseDOM&&(d=i&&375===screen.width&&812===screen.height&&3===window.devicePixelRatio),{isIPad:n,isIPhone:o,isIOS:i,isIPadOS:t,iosMajor:s,iosMinor:c,isWKWebView:u,isScrollBasedViewport:l,isIPhoneX:d,isIOSChrome:-1!==e.search(/crios/i)}}var i=o(),a=i.isIPad,s=i.isIPhone,c=i.isIOS,l=i.isIPadOS,u=i.iosMajor,d=i.iosMinor,_=i.isWKWebView,p=i.isScrollBasedViewport,h=i.isIPhoneX;function f(e){if(!r.canUseDOM)return!1;var t=!/ipad|iphone|ipod/.test(e);return!(!/mac os/.test(e)||!t||"boolean"!=typeof navigator.standalone)}i.isIOSChrome,t.isIPadOS=l,t.isIPad=a},79405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onDOMLoaded=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},t.canUseEventListeners=t.canUseDOM=void 0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n;var r=n&&!!window.addEventListener;t.canUseEventListeners=r},49598:(e,t,n)=>{"use strict";n.d(t,{classNames:()=>o});var r=n(90484);function o(){for(var e=[],t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.forEach((function(t){if(t)switch((0,r.default)(t)){case"string":e.push(t);break;case"object":Object.keys(t).forEach((function(n){t[n]&&e.push(n)}));break;default:e.push("".concat(t))}})),e.join(" ")}},92888:(e,t,n)=>{"use strict";n.d(t,{getLastDayOfMonth:()=>r});n(21058);function r(e,t){return 2==+t?function(e){return e%4==0&&e%100!=0||e%400==0}(e)?29:28:t>0&&(t<8&&t%2==0||t>7&&t%2==1)?30:31}},29327:(e,t,n)=>{"use strict";n.d(t,{isEqual:()=>o});var r=n(77270);function o(e,t){if(e===t)return!0;if(null==e||null==t||!(0,r.isObjectLike)(e)&&!(0,r.isObjectLike)(t))return e!=e&&t!=t;if((0,r.isObjectLike)(e)&&(0,r.isObjectLike)(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!e.hasOwnProperty(n)||!t.hasOwnProperty(n))return!1;if(!o(e[n],t[n]))return!1}return!0}return!1}},10628:(e,t,n)=>{"use strict";function r(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=o,l=Date.now();t&&l<t+r?(clearTimeout(n),n=setTimeout((function(){t=l,e.apply(c,a)}),r)):(t=l,e.apply(c,a))}}n.d(t,{throttle:()=>r})},77453:(e,t,n)=>{"use strict";function r(e){var t=e instanceof HTMLElement;if("undefined"==typeof window||!t)return{top:0,left:0,width:0,height:0};var n=e,r=n.getBoundingClientRect(),o=document.body,i=document.documentElement,a=window.pageYOffset||i.scrollTop||o.scrollTop,s=window.pageXOffset||i.scrollLeft||o.scrollLeft,c=i.clientTop||o.clientTop||0,l=i.clientLeft||o.clientLeft||0;return{top:Math.round(r.top+a-c),left:Math.round(r.left+s-l),width:n.offsetWidth,height:n.offsetHeight}}n.d(t,{getOffsetRect:()=>r})},59397:(e,t,n)=>{"use strict";n.d(t,{classNames:()=>r.classNames,isEqual:()=>o.isEqual,getLastDayOfMonth:()=>i.getLastDayOfMonth,throttle:()=>a.throttle,getOffsetRect:()=>s.getOffsetRect,isObject:()=>c.isObject});var r=n(49598),o=n(29327),i=n(92888),a=n(10628),s=n(77453),c=n(77270);n(33656)},21058:(e,t,n)=>{"use strict";function r(e){return e>=10?String(e):"0"+String(e)}n.d(t,{leadingZero:()=>r})},33656:(e,t,n)=>{"use strict";n(6610),n(5991),n(96156)},77270:(e,t,n)=>{"use strict";n.d(t,{isObjectLike:()=>o,isObject:()=>i});var r=n(90484);function o(e){return"object"===(0,r.default)(e)&&null!==e}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}},67253:(e,t,n)=>{"use strict";function r(){return{icon:'<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g id="cancel_16__Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="cancel_16__cancel_16"><path id="cancel_16__Rectangle" d="M0 0h16v16H0z"/><path d="M8 6.73l3.46-3.47a.9.9 0 111.28 1.28L9.27 8l3.47 3.46a.9.9 0 11-1.28 1.28L8 9.27l-3.46 3.47a.9.9 0 11-1.28-1.28L6.73 8 3.26 4.54a.9.9 0 011.28-1.28L8 6.73z" id="cancel_16__Mask" fill="currentColor" fill-rule="nonzero"/></g></g></svg>',name:"cancel_16"}}n.d(t,{getIcon16Cancel:()=>r})},62816:(e,t,n)=>{"use strict";function r(){return{icon:'<svg fill="none" height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><clipPath id="spinner_16__a"><path d="M0 0h16v16H0z"/></clipPath><g clip-path="url(#spinner_16__a)"><path clip-rule="evenodd" d="M11.21 2.93a6 6 0 00-8.64 7.62 1 1 0 11-1.8.86A8 8 0 118 16a1 1 0 110-2 6 6 0 003.21-11.07z" fill="currentColor" fill-rule="evenodd"/></g></svg>',name:"spinner_16"}}n.d(t,{getIcon16Spinner:()=>r})},39026:(e,t,n)=>{"use strict";function r(){return{icon:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="browser_back_24__Master" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="browser_back_24__browser_back_24"><path id="browser_back_24__body" d="M0 0h24v24H0z"/><path d="M8.66 12l7.12 7.12a1.1 1.1 0 11-1.56 1.56l-7.9-7.9a1.1 1.1 0 010-1.56l7.9-7.9a1.1 1.1 0 011.56 1.56L8.66 12z" id="browser_back_24__Path" fill="currentColor" fill-rule="nonzero"/></g></g></svg>',name:"browser_back_24"}}n.d(t,{getIcon24BrowserBack:()=>r})},20130:(e,t,n)=>{"use strict";function r(){return{icon:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="cancel_24__Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="cancel_24__cancel_24"><path id="cancel_24__Bounds" d="M0 0h24v24H0z"/><path d="M18.3 5.7a.99.99 0 00-1.4 0L12 10.6 7.1 5.7a.99.99 0 00-1.4 1.4l4.9 4.9-4.9 4.9a.99.99 0 001.4 1.4l4.9-4.9 4.9 4.9a.99.99 0 001.4-1.4L13.4 12l4.9-4.9a.99.99 0 000-1.4z" id="cancel_24__Mask" fill="currentColor"/></g></g></svg>',name:"cancel_24"}}n.d(t,{getIcon24Cancel:()=>r})},21324:(e,t,n)=>{"use strict";function r(){return{icon:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="favorite_24__Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="favorite_24__favorite_24"><path id="favorite_24__Bounds" d="M0 0h24v24H0z"/><path d="M15.34 8.48l4.43.43c1.54.15 2.02 1.65.83 2.64l-3.47 2.88 1.29 4.7c.42 1.54-.9 2.48-2.2 1.55L12 17.7l-4.21 2.98c-1.31.92-2.63 0-2.2-1.55l1.28-4.7-3.47-2.88c-1.2-1-.72-2.5.83-2.64l4.43-.43 1.95-4.5c.6-1.4 2.17-1.4 2.78 0l1.95 4.5z" id="favorite_24__Mask" fill="currentColor" fill-rule="nonzero"/></g></g></svg>',name:"favorite_24"}}n.d(t,{getIcon24Favorite:()=>r})},8928:(e,t,n)=>{"use strict";function r(){return{icon:'<svg fill="none" height="24" width="24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M12.55 4.7a.6.6 0 00-1.1 0L9.83 8.6a.9.9 0 01-.77.55l-4.13.26a.6.6 0 00-.35 1.05l3.26 2.86a.9.9 0 01.29.9l-.94 3.84a.6.6 0 00.89.66l3.47-2a.9.9 0 01.9 0l3.47 2a.6.6 0 00.88-.66l-.93-3.85a.9.9 0 01.29-.89l3.26-2.85a.6.6 0 00-.35-1.06l-4.13-.26a.9.9 0 01-.77-.56zM9.78 4a2.4 2.4 0 014.44 0l1.4 3.39 3.56.23a2.4 2.4 0 011.43 4.2l-2.86 2.5.8 3.32a2.4 2.4 0 01-3.53 2.64L12 18.54l-3.02 1.74a2.4 2.4 0 01-3.54-2.64l.8-3.32-2.85-2.5a2.4 2.4 0 011.43-4.2l3.56-.23z" fill="currentColor" fill-rule="evenodd"/></svg>',name:"favorite_outline_24"}}n.d(t,{getIcon24FavoriteOutline:()=>r})},60804:(e,t,n)=>{"use strict";function r(){return{icon:'<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M16.4 5.08A8.2 8.2 0 004.57 15.49a.9.9 0 01-1.63.77A10 10 0 1112 22a.9.9 0 010-1.8 8.2 8.2 0 004.4-15.12z" fill="currentColor" fill-rule="evenodd"/></svg>',name:"spinner_24"}}n.d(t,{getIcon24Spinner:()=>r})},26555:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});n(51876);var r=n(67294),o=n(45697);class i extends r.Component{static mapFilterOptionsToDropdownOptions(e){return e?e.map((e=>[e.constant,e.name])):[]}constructor(e){super(e),this.state={filterWrapElementId:this.props.config.id+"_filter_wrap",filterElementId:this.props.config.id+"_filter"}}componentDidMount(){var e=this.props.config.placeholder||"",t=this.onChange.bind(this);this.state.input=new Dropdown(ge(this.state.filterElementId),i.mapFilterOptionsToDropdownOptions(this.props.config.options),{selectedItems:this.props.config.selected,onChange:t,placeholder:e,multiselect:!this.props.singleSelectCrutch,autocomplete:!0,width:this.props.width,big:!0,maxItems:this.props.maxItems})}componentDidUpdate(e,t,n){if(this.props.config.selected!==e.config.selected&&Array.isArray(this.props.config.selected)&&0===this.props.config.selected.length)this.state.input.clear();else if(this.props.singleSelectCrutch){var r=this.state.input.selectedItems(),o=r&&r[0]&&r[0][0]?r[0][0]:null;if(!o)return;this.props.config.selected!==e.config.selected&&o!=this.props.config.selected&&this.state.input.selectItem(this.props.config.selected[0])}}onChange(e){var t=i.convertOldValueToJson(e);this.props.onFilterChange(this.props.config.id,t)}static convertOldValueToJson(e){return e?e.split(","):null}render(){var e=this.props.config.header?r.createElement("div",{className:"search_filter_main"},this.props.config.header):"";return r.createElement("div",{className:"filter"},e,r.createElement("div",{id:this.state.filterWrapElementId,className:"search_control"},r.createElement("input",{id:this.state.filterElementId,type:"text",className:"dark"})))}}i.propTypes={config:o.shape({id:o.string,header:o.string,options:o.arrayOf(o.shape({constant:o.any,name:o.string})),placeholder:o.string,selected:o.array}),onFilterChange:o.func.isRequired,width:o.number,maxItems:o.number,singleSelectCrutch:o.bool},i.defaultProps={width:200,maxItems:50,singleSelectCrutch:!1}},36680:(e,t,n)=>{"use strict";n.d(t,{SECOND:()=>r,MINUTE:()=>o});var r=1e3,o=60*r},89029:(e,t,n)=>{"use strict";n.d(t,{gemiusTrackPage:()=>o});var r=n(19331);function o(){if((0,r.partConfigEnabled)("geminus_counter")){var e="pzBAVLtpzyiyDVIwmwjmX5a2zSVdA6eUI7mpf0ufDFf.57";if(window.pp_gemius_identifier)window.pp_gemius_hit(e);else{window.pp_gemius_identifier=e;var t=function(e){window[e]=window[e]||function(){var t=window[e+"_pdata"]=window[e+"_pdata"]||[];t[t.length]=arguments}};t("gemius_hit"),t("gemius_event"),t("pp_gemius_hit"),t("pp_gemius_event"),function(e,t){try{var n=e.createElement(t),r=e.getElementsByTagName(t)[0],o="http"+("https:"==location.protocol?"s":""),i="vkgalv";if(window.vk&&window.vk.countryISO)switch(window.vk.countryISO){case"BY":i="vkgaby";break;case"MD":i="vkgamd";break;case"EE":i="vkgaee"}n.setAttribute("async","async"),n.setAttribute("defer","defer"),n.src=o+"://"+i+".hit.gemius.pl/xgemius.js",r.parentNode.insertBefore(n,r)}catch(e){}}(document,"script")}}}},28396:(e,t,n)=>{"use strict";n.d(t,{mediascopeTrackPage:()=>c});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767),n(83946),n(59357),n(51876);var r=n(40906),o=n(79957),i=n(19331);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){var n=location.protocol,s=`^https?:\\/\\/(?:(?:www|m)\\.)?(?:\\w+\\.)*${(0,r.escapeRE)("vk.com")}`,c=window._tns&&(window._tns.tnsPixelSocdem||"83"),l=t.replace(/\*/g,"%2a").split("#")[0],u=window._tns&&window._tns.tnsPixelType;if((0,r.vkImage)().src=`${n}//www.tns-counter.ru/V13a**clid:${c}*${l}*vk_com/ru/UTF-8/tmsec=vksite_total/${Math.round(1e9*Math.random())}`,(0,i.partConfigEnabled)("tns_track_sections")){var d="content",_="photo",p="music",h="video",f="clips",m="ecomm",g="games",v="docs",y=[...[[/w=story-?\d+_\d+/,d,"story"],[/z=video-?\d+_\d+/,h,"videoview"],[/z=(photo(_tag)?-?\d+_\d+|albums?-?\d+)/,_,"photoview"],[/z=audio_playlist-?\d+_\d+/,p,"playlistview"],[/z=podcast-?\d+_\d+/,p,"podcastview"],[/z=clip-?\d+_\d+/,f,"clipsview"],[/w=app\d+/,g,"gamesappview"],[/w=product-?\d+_\d+/,m,"product"]].map((e=>{var t=a(e,3),n=t[0],r=t[1],o=t[2];return[new RegExp(s+"\\b.*?\\b"+n.source),r,o]})),...[[/feed\?section=likes(\/|\&|$)/,d,"likes"],[/feed(\/|\?|$)/,d,"feed"],[/friends(\/|\?|$)/,d,"friends"],[/groups(\/|\?|$)/,d,"groups"],[/(id|public|club)\d+(\/|\?|$)/,d,"idpublicclub"],[/@[\w-\.]+(\/|\?|$)/,d,"longread"],[/bookmarks(\/|\?|$)/,d,"bookmarks"],[/stickers(\/|\?|$)/,d,"stickers"],[/im(\/|\?|$)/,"messenger","messenger"],[/(photos|tag\d+|(albums|photos)-?\d+|(album|photo)-?\d+_\d+)(\/|\?|$)/,_,"photo"],[/(audio(s-?\d+)?|music)(\/|\?|$)/,p,"music"],[/podcasts(-?\d+)(\/|\?|$)/,"podcasts","podcasts"],[/(videos-?\d+|video(-?\d+_\d+)?)(\/|\?|$)/,h,"video"],[/(clips(-?\d+)?|clip-?\d+_\d+)(\/|\?|$)/,f,"clips"],[/services(\/|\?|$)/,"services","services"],[/taxi(\/|\?|$)/,"taxi","taxi"],[/eda(\/|\?|$)/,"eda","eda"],[/worki(\/|\?|$)/,"worki","worki"],[/market(-?\d+)?(\/|\?|$)/,m,"ecomm"],[/apps(\/|\?|$)/,g,"gamesapp"],[/app\d+(_-?\d+)(\/|\?|$)/,g,"gamesapppage"],[/docs(\/|\?|$)/,v,"docs"],[/doc-?\d+_\d+(\/|\?|$)/,v,"docdoc"]].map((e=>{var t=a(e,3),n=t[0],r=t[1],o=t[2];return[new RegExp(s+"\\/"+n.source),r,o]}))],E=window.cur&&window.cur.module||"other",w="other",b="other";y.some((t=>{if(t[0].test(e))return w=t[1],b=t[2],!0})),(0,o.statlogsValueEvent)("counters_check_tns",w,b,E)}"unauth"===u?(0,r.vkImage)().src=n+"//www.tns-counter.ru/V13a****vk_ad/ru/UTF-8/tmsec=vkad_cid1015708-posid1184674/"+Math.round(1e9*Math.random()):"has_rough"===u?(0,r.vkImage)().src=n+"//www.tns-counter.ru/V13a****vk_ad/ru/UTF-8/tmsec=vkad_cid1015708-posid1184675/"+Math.round(1e9*Math.random()):"not_has_rough"===u&&((0,r.vkImage)().src=n+"//www.tns-counter.ru/V13a****vk_ad/ru/UTF-8/tmsec=vkad_cid1015708-posid1184677/"+Math.round(1e9*Math.random())),(0,i.partConfigEnabled)("tns_track_hosts")&&((0,r.vkImage)().src=`https://${function(){if(window.cur&&window.cur.module&&(0,r.isString)(window.cur.module)){var e=window.cur.module.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"");if(e)return e}return"unknown"}()}.tns.vk-portal.net?v=${Math.round(1e9*Math.random())}`)}},37668:(e,t,n)=>{"use strict";n.d(t,{tmrTrackPage:()=>d});n(75115);var r=n(76567),o=n(19331),i=n(79957);var a="2579437",s="remixtmr_login",c=["mt_registration","mt_login"];function l(){return window.vk&&window.vk.id?window.vk.id:0}function u(e){if(!(window.vk&&window.vk.zero||window.__dev)){if(e&&e.goal&&c.includes(e.goal)){if((0,o.partConfigEnabled)("mt_log_disable"))return;(0,i.statlogsValueEvent)("counters_check_tmr",e.goal)}window._tmr=window._tmr||[],window._tmr.push(e)}}function d(e,t){u({id:a,url:e,referrer:t,type:"pageView",start:(new Date).getTime(),pid:l(),userid:l()}),(0,r.getCookie)(s)&&((0,r.setCookie)(s,"",-1),u({id:a,type:"reachGoal",goal:"mt_login",userid:l()}))}},33304:(e,t,n)=>{"use strict";n.d(t,{updateCounters:()=>l});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767),n(59357);var r=n(89029),o=n(28396),i=n(37668),a=n(79957);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){if(!(window.__dev||window.vk&&(window.vk.zero||window.vk.__dev))){t=t||document.referrer||"";[[/(hash|dl)=\w+/g,"$1="],[/(\/(?:write|mail|im|al_im.php))(?:\?[a-z0-9&=_-]*)?$/,"$1"],[/(\/write)\d*(?:\?[a-zA-Z0-9&=_-]*)?$/,"$1"]].forEach((n=>{var r=s(n,2),o=r[0],i=r[1];e=e.replace(o,i),t=t.replace(o,i)})),(0,i.tmrTrackPage)(e,t);var n=[/\/login\?.*$/];n.some((t=>t.test(e)))||n.some((e=>e.test(t)))||((0,o.mediascopeTrackPage)(e,t),(0,r.gemiusTrackPage)(),(0,a.statlogsValueEvent)("counters_check",1))}}},24816:(e,t,n)=>{"use strict";n.d(t,{emojiRegex:()=>r,skinToneModifierRegex:()=>o,EMOJI_PREFIXED_REPLACES:()=>i,EMOJI_REPLACES:()=>a});var r=()=>/(?:\uD83C\uDFF4)(?:(?:\uDB40\uDC67)(?:\uDB40\uDC62)(?:(?:\uDB40\uDC65)(?:\uDB40\uDC6E)(?:\uDB40\uDC67)|(?:\uDB40\uDC77)(?:\uDB40\uDC6C)(?:\uDB40\uDC73)|(?:\uDB40\uDC73)(?:\uDB40\uDC63)(?:\uDB40\uDC74))(?:\uDB40\uDC7F)|\u200D\u2620\uFE0F?)|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC69)\u200D(?:(?:\uD83D\uDC66)\u200D(?:\uD83D\uDC66)|(?:\uD83D\uDC67)\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83D\uDC68)(?:\u200D(?:\u2764\uFE0F?\u200D(?:(?:\uD83D\uDC8B)\u200D)?(?:\uD83D\uDC68)|(?:\uD83D[\uDC68\uDC69])\u200D(?:(?:\uD83D\uDC66)\u200D(?:\uD83D\uDC66)|(?:\uD83D\uDC67)\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83D\uDC66)\u200D(?:\uD83D\uDC66)|(?:\uD83D\uDC67)\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|(?:\uD83D\uDC69)\u200D(?:\u2764\uFE0F?\u200D(?:(?:\uD83D\uDC8B)\u200D(?:\uD83D[\uDC68\uDC69])|(?:\uD83D[\uDC68\uDC69]))|(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC66)\u200D(?:\uD83D\uDC66)|(?:(?:\uD83D\uDC41)\uFE0F?\u200D(?:\uD83D\uDDE8)|(?:\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|(?:\uD83D\uDC68)(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F?|(?:\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]))\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|(?:\uD83D\uDC69)\u200D[\u2695\u2696\u2708])\uFE0F?|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC67)\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC69)\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC68)(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC66\uDC67]))|(?:\uD83C[\uDFFB-\uDFFF]))|(?:\uD83C\uDFF3)\uFE0F?\u200D(?:\uD83C\uDF08)|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC67)|(?:\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83D\uDC69)\u200D(?:\uD83D\uDC66)|(?:\uD83C\uDDF6)(?:\uD83C\uDDE6)|(?:\uD83C\uDDFD)(?:\uD83C\uDDF0)|(?:\uD83C\uDDF4)(?:\uD83C\uDDF2)|(?:\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C\uDDED)(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|(?:\uD83C\uDDEC)(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|(?:\uD83C\uDDEA)(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|(?:\uD83C\uDDE8)(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\uD83C\uDDF2)(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|(?:\uD83C\uDDF3)(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|(?:\uD83C\uDDFC)(?:\uD83C[\uDDEB\uDDF8])|(?:\uD83C\uDDFA)(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|(?:\uD83C\uDDF0)(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|(?:\uD83C\uDDEF)(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C\uDDF8)(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|(?:\uD83C\uDDEE)(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|(?:\uD83C\uDDFF)(?:\uD83C[\uDDE6\uDDF2\uDDFC])|(?:\uD83C\uDDEB)(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|(?:\uD83C\uDDF5)(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|(?:\uD83C\uDDE9)(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|(?:\uD83C\uDDF9)(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|(?:\uD83C\uDDE7)(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F?\u20E3|(?:\uD83C\uDDF1)(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|(?:\uD83C\uDDE6)(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|(?:\uD83C\uDDF7)(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|(?:\uD83C\uDDFB)(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|(?:\uD83C\uDDFE)(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g,o=/\uFE0F?\uD83C[\uDFFB-\uDFFF]/,i={e29da4:/(\s|^)([0OО]:\))([\s\.,]|$)/g,f09f9887:/(\s|^)(;-\)+)([\s\.,]|$)/g,f09f9889:/(\s|^)([XХxх]-?D)([\s\.,]|$)/g,f09f9886:/(\s|^)(B-\))([\s\.,]|$)/g,f09f988e:/(\s|^)(3-\))([\s\.,]|$)/g,f09f988c:/(\s|^)(&gt;\()([\s\.,]|$)/g,f09f98a0:/(\s|^)(;[oоOО])([\s\.,]|$)/g,f09f98b0:/(\s|^)(8\|)([\s\.,]|$)/g,f09f98b3:/(\s|^)(8-?[oоOО])([\s\.,]|$)/g,f09f98b2:/(\s|^)(8-\))([\s\.,]|$)/g,f09f988d:/(\s|^)(:[XХ])([\s\.,]|$)/g,f09f98b7:/(\s|^)(:[oоOО])([\s\.,]|$)/g,f09f98a8:/(\s|^)(&lt;3)([\s\.,]|$)/g},a={f09f988a:/(:-\))([\s\.,]|$)/g,f09f9883:/(:-D)([\s\.,]|$)/g,f09f989c:/(;-[PР])([\s\.,]|$)/g,f09f988b:/(:-[pр])([\s\.,]|$)/g,f09f9892:/(:-\()([\s\.,]|$)/g,e298ba:/(:-?\])([\s\.,]|$)/g,f09f988f:/(;-\])([\s\.,]|$)/g,f09f9894:/(3-?\()([\s\.,]|$)/g,f09f98a2:/(:&#039;\()([\s\.,]|$)/g,f09f98ad:/(:_\()([\s\.,]|$)/g,f09f98a9:/(:\(\()([\s\.,]|$)/g,f09f9890:/(:\|)([\s\.,]|$)/g,f09f98a1:/(&gt;\(\()([\s\.,]|$)/g,f09f989a:/(:-\*)([\s\.,]|$)/g,f09f9888:/(\}:\))([\s\.,]|$)/g,f09f918d:/(:like:)([\s\.,]|$)/g,f09f918e:/(:dislike:)([\s\.,]|$)/g,e2989d:/(:up:)([\s\.,]|$)/g,e29c8c:/(:v:)([\s\.,]|$)/g,f09f918c:/(:ok:|:ок:)([\s\.,]|$)/g}},98884:(e,t,n)=>{"use strict";n.d(t,{emojiToHTML:()=>a});n(91181),n(96253),n(59357);var r=n(24816),o=n(54259),i=n(49849);function a(e,t){if(browser.ipad||browser.iphone)return e;e=(e+"").replace(/&nbsp;/g," ").replace(/<br>/g,"\n");for(var n=0;n<2;n++)Object.keys(r.EMOJI_PREFIXED_REPLACES).forEach((t=>{e.replace(r.EMOJI_PREFIXED_REPLACES[t],((e,n,r,o)=>(n||"")+s(t)+(o||"")))}));return Object.keys(r.EMOJI_REPLACES).forEach((t=>{e=e.replace(r.EMOJI_REPLACES[t],((e,n,r)=>s(t)+(r||"")))})),e=e.replace(/\n/g,"<br>"),t&&(e=e.replace(/\uFE0F/g,"").replace((0,r.emojiRegex)(),c)),e}function s(e,t,n,r){return!n&&t?t:r?`<i class="emoji @${e}" emoji="${e}"${t?` title="${t}"`:""}></i>`:`<img class="emoji" src="/emoji/e/${e}${window.devicePixelRatio>=2?"_2x":""}.png"${t?` alt="${t}"`:""}${browser.msie&&Number(browser.version)>8?' contenteditable="false"':""}>`}function c(e){return s((0,o.emojiSymbolToByteHex)(e),(0,i.encodeHTMLEntities)(e),!0)}},54259:(e,t,n)=>{"use strict";n.d(t,{emojiSymbolToByteHex:()=>r});n(51876),n(59357),n(24816);function r(e){return encodeURIComponent(e.replace(/\uFE0F/gi,"")).replace(/%/gi,"").toLowerCase()}},49849:(e,t,n)=>{"use strict";n.d(t,{symbols:()=>i,escape:()=>a,encodeHTMLEntities:()=>s,decodeHTMLEntities:()=>c});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767),n(83946),n(59357);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i=[["&amp;","&"],["&lt;","<"],["&gt;",">"],["&quot;",'"']];function a(e){return i.reduce(((e,t)=>{var n=r(t,2),o=n[0],i=n[1];return e.replace(new RegExp(i,"ig"),o)}),e)}function s(e){return a(e).replace(/[\u00A0-\u9999<>\&]/gim,(e=>`&#${e.charCodeAt(0)};`))}function c(e){return i.reduce(((e,t)=>{var n=r(t,2),o=n[0],i=n[1];return e.replace(new RegExp(o,"ig"),i)}),e).replace(/&#(\d+);/g,((e,t)=>String.fromCodePoint(t)))}},26271:(e,t,n)=>{"use strict";n.d(t,{browser:()=>d,mobPlatforms:()=>_,browserFeatures:()=>p,redirectToMVK:()=>h,initBrowserUtils:()=>f});n(30522),n(91181),n(79665),n(95767),n(66108),n(96253),n(75115),n(83946),n(59357),n(51876),n(21466);var r=n(55971),o=n(76567),i=n(68040),a=n(61540);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u=navigator.userAgent.toLowerCase(),d={version:(u.match(/.+(?:me|ox|on|rv|it|era|opr|ie|edge)[\/: ]([\d.]+)/)||[0,"0"])[1],opera:/opera/i.test(u)||/opr/i.test(u),vivaldi:/vivaldi/i.test(u),amigo:/amigo.*mrchrome soc/i.test(u),msie:/msie/i.test(u)&&!/opera/i.test(u)||/trident\//i.test(u)||/edge/i.test(u),msie6:/msie 6/i.test(u)&&!/opera/i.test(u),msie7:/msie 7/i.test(u)&&!/opera/i.test(u),msie8:/msie 8/i.test(u)&&!/opera/i.test(u),msie9:/msie 9/i.test(u)&&!/opera/i.test(u),msie_edge:/edge/i.test(u)&&!/opera/i.test(u),mozilla:/firefox/i.test(u),yabrowser:/yabrowser/i.test(u),whale:/whale/i.test(u),chrome:/chrome/i.test(u)&&!/edge/i.test(u),safari:!/chrome/i.test(u)&&/webkit|safari|khtml/i.test(u),iphone:/iphone/i.test(u),ipod:/ipod/i.test(u),iphone4:/iphone.*OS 4/i.test(u),ipod4:/ipod.*OS 4/i.test(u),ipad:/ipad/i.test(u),android:/android/i.test(u),bada:/bada/i.test(u),mobile:/iphone|ipod|ipad|opera mini|opera mobi|iemobile|android/i.test(u),msie_mobile:/iemobile/i.test(u),safari_mobile:/iphone|ipod|ipad/i.test(u),opera_mobile:/opera mini|opera mobi/i.test(u),opera_mini:/opera mini/i.test(u),mac:/mac/i.test(u),windows7:/windows nt 6.1/i.test(u),windowsVista:/windows nt 6.0/i.test(u),windowsXp:/windows nt (5.2|5.1)/i.test(u),search_bot:/(yandex|google|stackrambler|aport|slurp|msnbot|bingbot|twitterbot|ia_archiver|facebookexternalhit)/i.test(u),smart_tv:/smart-tv|smarttv/i.test(u)},_={1:1,2:1,3:1,4:1,5:1,8:1},p={wheelEvent:"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":d.mozilla?"MozMousePixelScroll":"DOMMouseScroll",hasBoundingClientRect:"getBoundingClientRect"in document.createElement("div"),cmaEnabled:navigator.credentials&&navigator.credentials.preventSilentAccess&&window.vk&&vk.cma};function h(){var e,t=s(location.href.split("?"),2),n=t[0],r=t[1],o={},l=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=c(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(new URLSearchParams(r));try{for(l.s();!(e=l.n()).done;){var u=e.value;o[u[0]]=u[1]}}catch(e){l.e(e)}finally{l.f()}if(o){if("1"===o.m)return;if(o.force_redirect_to_mvk){delete o.force_redirect_to_mvk;var d=(0,i.toQueryString)(o);return void(window.location=n.replace(a.VK_ORIGIN_REGEX_STRICT,"https://m."+(0,a.getHostName)())+(d?"?"+d:""))}}if(a.VK_URL_REGEX.test(n)&&!new RegExp("^"+a.VK_HOST_REGEX_UNSAFE.source+"\\/@").test(n)){var _=Object.assign(o,{force_redirect_to_mvk:1}),p=n+"?"+(0,i.toQueryString)(_);window.location=p}}function f(){(0,r.isIPadOS)(d)&&!(0,o.getCookie)("remixforce_full")&&h(),window._ua||(window._ua=navigator.userAgent.toLowerCase()),window.locDomain||(window.locDomain=location.host.toString().match(/[a-zA-Z]+\.[a-zA-Z]+\.?$/)[0]),window.locHost=location.host,window.locProtocol=location.protocol,window.locHash=location.hash.replace("#/","").replace("#!","")}},40906:(e,t,n)=>{"use strict";n.d(t,{rand:()=>o,replaceEntities:()=>p,isArray:()=>c,isEmpty:()=>u,isFunction:()=>a,isNumeric:()=>d,isObject:()=>l,isString:()=>s,isUndefined:()=>i,irand:()=>h,escapeRE:()=>_,each:()=>g,vkNow:()=>f,locBase:()=>r,defaults:()=>v,intval:()=>m,vkImage:()=>y});n(75115),n(51876),n(66108),n(96253),n(59357);var r=()=>location.toString().replace(/#.+$/,""),o=(e,t)=>Math.random()*(t-e+1)+e,i=e=>void 0===e,a=e=>e&&"[object Function]"===Object.prototype.toString.call(e),s=e=>"string"==typeof e,c=e=>"[object Array]"===Object.prototype.toString.call(e),l=e=>"[object Object]"===Object.prototype.toString.call(e),u=e=>{if(!l(e))return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},d=e=>!isNaN(parseFloat(e))&&isFinite(e)&&!Array.isArray(e),_=e=>e?e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1"):"",p=e=>ce("textarea",{innerHTML:(e||"").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}).value,h=(e,t)=>Math.floor(o(e,t));var f=()=>+new Date;function m(e){return!0===e?1:parseInt(e)||0}function g(e,t){if(!e)return e;if(l(e)||void 0===e.length){for(var n in e)if(e.hasOwnProperty(n)&&!1===t.call(e[n],n,e[n]))break}else for(var r=0,o=e.length;r<o;r++){var i=e[r];if(!1===t.call(i,r,i))break}return e}var v=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign({},e,...n.reverse(),e)},y=()=>window.Image?new Image:ce("img")},22463:(e,t,n)=>{"use strict";n.d(t,{log:()=>i,error:()=>a});var r=n(19331);function o(){return window.console&&(0,r.partConfigEnabled)("js_console_logs")}function i(){o()&&window.console.log&&window.console.log(...arguments)}function a(){o()&&(window.console.error?window.console.error(...arguments):i(...arguments))}},68040:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromQueryString:()=>c,toQueryString:()=>s});n(51876),n(20075);var r=n(40906),o={},i=function(e){if(o[e])return e;try{return encodeURIComponent(e)}catch(e){return""}},a=function(e){try{return decodeURIComponent(e)}catch(t){return o[e]=1,e}};function s(e,t){var n=[];for(var o in e)if(e.hasOwnProperty(o)&&null!=e[o]&&!(0,r.isFunction)(e[o]))if((0,r.isArray)(e[o]))for(var a=0,s=0,c=e[o].length;a<c;++a)null==e[o][a]||(0,r.isFunction)(e[o][a])||(n.push(i(o)+"["+s+"]="+i(e[o][a])),++s);else n.push(i(o)+"="+i(e[o]));return t||n.sort(),n.join("&")}function c(e){if(!e)return{};var t={};return e=e.split("&"),(0,r.each)(e,(function(e,n){var r=n.split("=");if(r[0]){var o=a(r[1]+"");if("[]"===r[0].substr(r.length-2)){var i=a(r[0].substr(0,r.length-2));t[i]||(t[i]=[]),t[i].push(o)}else t[a(r[0])]=o}})),t}},76567:(e,t,n)=>{"use strict";n.d(t,{getCookie:()=>s,setCookie:()=>l,initCookies:()=>u});n(21466),n(51876);var r=n(19331),o=n(79957),i=n(66433);function a(){return browser.chrome&&parseInt(browser.version)>=71}function s(e){return function(){window._cookies={};for(var e=document.cookie.split(";"),t=/^[\s]*([^\s]+?)$/i,n=0,r=e.length;n<r;n++){var o=e[n].split("=");2===o.length&&(_cookies[o[0].match(t)[1]]=unescape(o[1].match(t)?o[1].match(t)[1]:""))}}(),"https:"!==location.protocol&&(0,o.statlogsValueEvent)("read_unsecure_cookie",e,location.href),_cookies[e]}function c(e,t){var n=(0,r.getCookieGroups)(),o=function(){var e=s("remixcpl");if(!e)return[];var t=e.split(",");return t.forEach(((e,n)=>{t[n]=parseInt(e)})),t}(),a=e,c=null;if(!(0,r.partConfigEnabled)("need_check_allowed_cookie"))return!0;if(!isNaN(parseInt(t))&&parseInt(t)<0)return!0;"remix"===a.substr(0,5)&&(a=a.substr(5)),n.hasOwnProperty(e)?c=parseInt(n[e]):n.hasOwnProperty(a)?c=parseInt(n[a]):"q_"===a.substr(0,2)&&n.hasOwnProperty("q_")&&(c=parseInt(n.q_)),(null===c||isNaN(c))&&(0,i.logError)(`Undefined cookie group for cookie ${e} (${a})`);return 1===c||!(isNaN(c)||!o.includes(c))}function l(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"None",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window.locDomain,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{};if(!c(e,n))return!1;var u=e+"="+escape(t),d=l.withoutSubdomains?".":"",_="; path=/"+(s?"; domain="+d+s:""),p="https:"===location.protocol,h=!!o;(0,r.partConfigEnabled)("cookie_secure_default_true")&&(h=!1!==o);var f=p&&h?"; secure":"",m=h&&a()&&(0,r.partConfigEnabled)("cookie_class_samesite")?`; SameSite=${i}`:"",g="";if(n){var v=new Date;v.setTime(v.getTime()+24*n*60*60*1e3),g="; expires="+v.toGMTString()}return document.cookie=u+g+_+m+f,!0}function u(){window._cookies={}}},9720:(e,t,n)=>{"use strict";function r(e,t,n){var r;return function(){var o=arguments,i=()=>{r=null,n||e.apply(this,o)},a=n&&!r;clearTimeout(r),r=setTimeout(i,t),a&&e.apply(this,o)}}n.d(t,{debounce:()=>r})},55971:(e,t,n)=>{"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.browser;return!(!e.mac||e.iphone||e.ipad||e.ipod||!(navigator.maxTouchPoints>1))}n.d(t,{isIPadOS:()=>r,isDarkTheme:()=>o,isLightTheme:()=>i,isCSSVariablesSupported:()=>a,isAutoSchemesSupported:()=>s});var o=()=>Boolean(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches),i=()=>Boolean(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches),a=()=>Boolean(window.CSS&&CSS.supports&&CSS.supports("color","var(--custom-property)")),s=()=>Boolean(window.matchMedia&&window.matchMedia("(prefers-color-scheme)").matches)},61508:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(94795);window.EventEmitter=r;const o=r},95283:(e,t,n)=>{"use strict";n.d(t,{decodeHTMLEntities:()=>s});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767),n(83946),n(59357),n(98884);var r=n(49849);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=r.symbols;r.encodeHTMLEntities,r.escape;function s(e){return a.reduce(((e,t)=>{var n=o(t,2),r=n[0],i=n[1];return e.replace(new RegExp(r,"ig"),i)}),e).replace(/&#(\d+);/g,((e,t)=>String.fromCodePoint(t)))}},81117:(e,t,n)=>{"use strict";n.d(t,{showComponentInBox:()=>o,updateCurrentComponentInBox:()=>i,destroyComponentInBox:()=>a});var r=n(73935);n(67294);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.onDestroy||(t.onDestroy=a);var n=window.showFastBox(t),o=document.querySelectorAll(".box_layout"),i=o[o.length-1];return r.render(e,i),s(),n}function i(e){var t=document.querySelectorAll(".box_layout"),n=t[t.length-1];r.render(e,n)}function a(e){var t=document.querySelectorAll(".box_layout"),n=t[t.length-1];n&&r.unmountComponentAtNode(n);var o=window.curBox();o&&o.hide(e)}function s(){var e=document.querySelectorAll(".popup_box_container"),t=e[e.length-1];boxRefreshCoords(t)}window.applicationInitFunctions||(window.applicationInitFunctions={}),window.reactInitQueue||(window.reactInitQueue={}),window.initReactApplication=(e,t)=>{window.applicationInitFunctions[e]?window.applicationInitFunctions[e](t):(window.reactInitQueue[e]||(window.reactInitQueue[e]=[]),window.reactInitQueue[e].push(t))}},26330:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var r=n(22683);function o(e){try{r.vkLocalStorage.removeItem(e)}catch(e){}}const i={checkVersion:function(){try{return void 0!==window.localStorage&&null!==window.localStorage&&void 0!==window.JSON}catch(e){return!1}},remove:o,get:function(e){try{return JSON.parse(r.vkLocalStorage.getItem(e))}catch(e){return!1}},set:function(e,t){o(e);try{return r.vkLocalStorage.setItem(e,JSON.stringify(t))}catch(e){return!1}}}},91040:(e,t,n)=>{"use strict";n.d(t,{retryFn:()=>o,throttledPromise:()=>i});n(40851),n(96253);function r(e,t){return new Promise((n=>{setTimeout(n.bind(null,t),1e3*e)}))}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=0;return function i(){for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return Promise.resolve().then((()=>e(...s))).catch((e=>{if(++o<=t){var a="function"==typeof n?n(o):0;return 0===a?i(...s):r(a).then((()=>i(...s)))}throw e}))}}function i(e,t){var n,r,o;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return new Promise(((e,i)=>{var s=Date.now(),c=()=>{e(a),n=s};!n||n+t<s?c():(o&&(o.reject(),clearTimeout(r)),o={resolve:e,reject:i},r=setTimeout(c,t-(s-n)))})).then((t=>e(...t)))}}},79957:(e,t,n)=>{"use strict";n.d(t,{statlogsValueEvent:()=>u});var r,o,i=n(76567),a=n(61540),s=n(40906),c=n(26330);(0,a.isMvk)()?(r="lock_m_stats_cookie_lock",o="remixmsts"):(r="lockkk_stats_cookie_lock",o="remixsts");var l=[];function u(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var c;void 0!==e&&void 0!==t&&(l.forEach((n=>n(e,t,...r))),d((()=>{try{c=(c=JSON.parse((0,i.getCookie)(o))).data}catch(e){c=[]}c.push([Math.round(Date.now()/1e3),e,t].concat(r)),c=c.slice(-100);var n=Math.round((0,s.rand)(0,1e9));(0,i.setCookie)(o,JSON.stringify({data:c,uniqueId:n}),.01)})))}function d(e,t){if(c.default.checkVersion()){if(!0!==c.default.get(r)){c.default.set(r,!0);try{e()}catch(e){}return void c.default.set(r,!1)}t||setTimeout((()=>d(e,!0)),100)}else e()}},19331:(e,t,n)=>{"use strict";n.d(t,{randEnabled:()=>o,partConfigEnabled:()=>i,getCookieGroups:()=>a,calculateTimeOffsets:()=>s});var r=n(76567);function o(e){return Math.random()<e}function i(e){var t=(window.vk||{}).pe;return!!(void 0===t?{}:t)[e]}function a(){var e=(window.vk||{}).acl;return void 0===e?{}:e}function s(){var e=window.vk.ts;if(e&&!window.browser.opera_mobile){var t=new Date,n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())/1e3-e;n-=10800,n=(n/=60).toFixed(0),(n*=60)<-55800?n+=86400:n>37800&&(n-=86400);var o=0,i=Math.abs(n);[-12,-11,-10,-9.5,-9,-8,-7,-6,-5,-4.5,-4,-3.5,-3,-2,-1,0,1,2,3,3.5,4,4.5,5,5.5,5.75,6,6.5,7,8,8.75,9,9.5,10,10.5,11,12,12.75,13,14].forEach((e=>{var t=Math.round(3600*(e-3)),r=Math.abs(n-t);r<i&&(i=r,o=t)}));var a=(0,r.getCookie)("remixdt");return void 0!==a&&intval(a)===o||(0,r.setCookie)("remixdt",o,365),o}return 0}},97213:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});n(51876);var r="idle",o="pend_rows",i="pend_prefetch",a="done_prefetch",s="done";class c{constructor(e,t){if(this.constructor!==c)throw new Error("AutoList: AutoList was called without 'new' operator");if(c._counter=c._counter||0,this._id=c._counter++,this.setListEl(e,t.scrollNode),this._opts=extend({threshold:0,renderImmediate:!1,fetchImmediate:!0},t),!this._containerEl)throw new Error("AutoList: container not found");this._rowClasses=!!this._opts.rowClass&&this._opts.rowClass.split(" "),delete this._opts.rowClass,this._initialRender=this._opts.renderImmediate,this._isProgressShown=!1,this._prefetched=[],this._initialRender?this._offset=0:this._opts.offset?this._offset=this._opts.offset:this._opts.rowClasses?this._offset=this._countRows(this._containerEl.children):this._offset=this._containerEl.children.length,this._page=this._offset>0?1:0,addEvent(this._scrollNode,"scroll",this._ev_scroll=this._onScroll.bind(this)),addEvent(window,"resize",this._ev_window_resize=this._onScroll.bind(this)),this._setState(this._opts.renderImmediate?o:i),this._opts.fetchImmediate?this._requestRows():(this._setState(r),this._onScroll())}getListEl(){return this._containerEl}setListEl(e,t){var n;this._containerEl=ge(e),this._scrollNode=t||c.closestOverflowParent(this._containerEl),n=this._scrollNode===window?0:getXY(this._scrollNode)[1],this._contentYOffset=getXY(this._containerEl)[1]-n}options(e){extend(this._opts,e)}_countRows(e){var t=this,n=0;return each(e,(function(e,r){"string"==typeof r&&(r=se(r)),t._rowClasses?each(t._rowClasses,(function(e,t){if(hasClass(r,t))return n++,!1})):n++})),n}_drawRows(e){var t=this;this._opts.drawRows?this._opts.drawRows(t._containerEl,e):each(e,(function(e,n){"string"==typeof n&&(n=se(trim(n))),n&&t._containerEl.appendChild(n)})),this.toggleProgress(this._state!==s),!this._forceDrawCalled&&this._opts.onRendered&&this._opts.onRendered(this._offset)}toggleProgress(e){e?!this._isProgressShown&&this._opts.showProgress&&this._opts.showProgress():this._isProgressShown&&this._opts.hideProgress&&this._opts.hideProgress(),this._isProgressShown=e}drawMore(){inArray(this._state,[r,a])?(this._forceDrawCalled=!0,this._drawRows(this._prefetched),this._setState(i),this._prefetched=[],this._requestRows(),this._forceDrawCalled=!1):this._state===s&&this._opts.onNoMore&&this._opts.onNoMore(this._containerEl.childElementCount)}destroy(){this._ev_scroll&&(removeEvent(this._scrollNode,"scroll",this._ev_scroll),this._ev_scroll=!1),this._ev_window_resize&&removeEvent(window,"resize",this._ev_window_resize),this._setState(s),this.toggleProgress(!1)}getOffset(){return this._offset}_requestRows(){if(!this.isDone()&&this._state!==a){function e(){this._opts.onNeedRows(this._onRowsProvided.bind(this),this._offset,this._page++,this._state===i,this)}this._initialRender=!1,e.apply(this)}}_onRowsProvided(e,t){if(!this.isDone()){if(!1===e)return this._requestRows();e=e||[],this._offset+=void 0===t?this._countRows(e):t;var n=this._containerEl.childElementCount;switch(this._state){case i:0===e.length?(this._setState(a),this._opts.onNoMore&&this._opts.onNoMore(n),0===this._prefetched.length&&this._setState(s)):(this._setState(r),this._prefetched=this._prefetched.concat(e),this._opts.onHasMore&&this._opts.onHasMore(),this._onScroll());break;case o:this._drawRows(e),0===e.length?(this._setState(s),this._opts.onNoMore&&this._opts.onNoMore(n)):(this._setState(i),this._requestRows()),this.toggleProgress(!1);break;case r:this._prefetched=this._prefetched.concat(e)}}}_setState(e){this._state=e}isDone(){return this._state===s}static closestOverflowParent(e){for(var t=e;t&&t.tagName&&("visible"===getStyle(t,"overflow")||"page_wrap"===t.id);)t=domPN(t);return t!==window.document&&t!==bodyNode&&t||(t=window),t}_onScroll(){if(!this._forceDrawCalled&&this._state!==o){var e,t,n=this._scrollNode;n===window?(t=Math.max(document.documentElement.clientHeight,window.innerHeight||0),e=scrollGetY()):(t=getSize(n)[1],e=this._scroll?this._scroll.data.scrollTop:n.scrollTop),t<10||this._containerEl.scrollHeight-t-e+this._contentYOffset<10&&(this._state===o||!this._prefetched.length&&this._state===i?(this.toggleProgress(!0),this._setState(o)):this._state===i||this._state===r?(this._drawRows(this._prefetched),this._prefetched=[],this._setState(i),this._requestRows()):this._state===a&&(this._drawRows(this._prefetched),this._prefetched=[],this._setState(s),this._opts.onNoMore&&this._opts.onNoMore(),this.destroy()))}}}},47612:(e,t,n)=>{"use strict";n.d(t,{UIGallery:()=>i});var r=n(69687),o=(0,r.makeSharedState)("ui-gallery",(()=>({galleries:{},incIndex:0})));class i{constructor(e,t){if(!e)throw new Error("No element was provided for UIGallery");if(e=ge(e),!hasClass(e,"ui_gallery"))throw new Error("Provided incorrect element for UIGallery");var n=function(e){var t=domData(ge(e),"gallery-id");return t&&o().galleries[t]}(e);if(n)return n;this._opts=extend({markOutside:!1,scrollY:!0,scrollX:!0,noArrows:!1},t),this._id=o().incIndex,o().incIndex+=1,this._el=e,this._width=getSize(this._el)[0],this._items=geByClass("ui_gallery_item",this._el),this._itemWidth=getSize(this._items[0])[0],this._itemOffset=intval(getStyle(this._items[0],vk.rtl?"marginLeft":"marginRight")),this._scrollOffset=intval(getStyle(this._items[0],"marginLeft")),this._itemFullWidth=this._itemWidth+this._itemOffset,this._innerCont=geByClass1("ui_gallery__inner_cont",this._el),this._inner=geByClass1("ui_gallery__inner",this._el),this._scroll=function(){var e={rtl:!1,backward:!1,delta:1,negative:!1,rtlSame:!1};if(!vk.rtl)return e;if(!cur._scrollInfo){var t=se('<div style="position: fixed; left: -1000; width: 0; overflow: scroll">x</div>');ge("content").appendChild(t);var n=t.scrollLeft;e.rtl=vk.rtl,e.backward=n>0,t.scrollLeft=1e3,e.delta=t.scrollLeft===n?-1:1,e.negative=!e.backward&&e.delta<0,e.rtlSame=e.rtl&&!e.backward&&!e.negative,re(t),cur._scrollInfo=e}return cur._scrollInfo}(),this._loadingMore=!1,this._finised=!1,this._visible={left:-1,right:-1,items:[]},this._outside={left:-1,right:-1,timer:null},this._initScroll(),this._initArrows(),domData(this._el,"gallery-id",this._id),o().galleries[this._id]=this,this._checkItemsAfterScroll(this._innerCont.scrollLeft,!0)}_initScroll(){(this._opts.scrollX||this._opts.scrollY)&&addEvent(this._innerCont,"DOMMouseScroll wheel",this._onWheelScroll.bind(this))}_initArrows(){this._opts.noArrows?addClass(this._el,"ui_gallery_no_arrows"):(this._leftArrow=geByClass1("ui_gallery__arrow_left",this._el),this._rightArrow=geByClass1("ui_gallery__arrow_right",this._el),this._arrowWidth=getSize(this._leftArrow)[0],addEvent(this._leftArrow,"click",this._onArrowScroll.bind(this,-1)),addEvent(this._leftArrow,"mouseover",this._onArrowMouseOver.bind(this,"left")),addEvent(this._leftArrow,"mouseout",this._onArrowMouseOut.bind(this)),addEvent(this._rightArrow,"click",this._onArrowScroll.bind(this,1)),addEvent(this._rightArrow,"mouseover",this._onArrowMouseOver.bind(this,"right")),addEvent(this._rightArrow,"mouseout",this._onArrowMouseOut.bind(this)))}_onWheelScroll(e){if(this._opts.scrollX||this._opts.scrollY){var t;if("wheel"==e.type)if(Math.abs(e.deltaY)>Math.abs(e.deltaX)){if(!this._opts.scrollY)return;t=-e.deltaY}else{if(!this._opts.scrollX)return;t=-e.deltaX}else if(void 0!==e.wheelDeltaY){if(!this._opts.scrollY)return;t=e.wheelDeltaY}else if(void 0!==e.wheelDelta)t=e.wheelDelta;else{if(!e.detail||1!==e.axis)return;t=-e.detail}t=this._scroll.rtlSame?-t:t,Math.abs(t)>=120&&(t=74*Math.max(-1,Math.min(1,t))),this._innerCont.scrollLeft-=t,this._checkItemsAfterScroll(this._innerCont.scrollLeft),cancelEvent(e)}}_onArrowScroll(e,t){if(!this._opts.noArrows){var n=this._innerCont.scrollLeft+(this._scroll.rtlSame?-e:e)*(this._width-2*this._arrowWidth),r=this._innerCont.scrollWidth-this._width;this._scroll.negative?(n=Math.min(n,0),n=Math.abs(n)):n=Math.max(0,n),n=Math.min(r,n);var o=this._scroll.negative||this._scroll.rtlSame?-e:e;if(o>0&&n<r)n=Math.floor(n/this._itemFullWidth)*this._itemFullWidth;else if(o<0&&n>0){n=Math.floor(n/this._itemFullWidth)*this._itemFullWidth}if(0===n||n===r){var i=this._innerCont.scrollWidth;addClass(this._inner,"ui_gallery__inner_shift_instant"),this._onArrowMouseOut(),n&&(n+=e*(this._innerCont.scrollWidth-i))}this._scroll.negative&&(n=-n),animate(this._innerCont,{scrollLeft:n},{duration:Math.abs(this._innerCont.scrollLeft-n)+50,transition:Fx.Transitions.easeOutCubic}),this._checkItemsAfterScroll(n),setTimeout((()=>removeClass(this._inner,"ui_gallery__inner_shift_instant")),0),cancelEvent(t)}}_checkItemsAfterScroll(e,t){if(this._scroll.negative&&(e=Math.abs(e)),this._opts.markOutside||this._opts.onViewItem){var n,r=this._itemWidth/3,o=(this._scroll.backward?this._inner.scrollWidth-this._width-e:e)-this._scrollOffset,i=e&&Math.floor(o/this._itemFullWidth),a=i*this._itemFullWidth+2*r;n=this._scroll.backward?e+this._width<this._inner.scrollWidth-a:e>a;var s,c=Math.min(this._items.length-1,Math.floor((o+this._width)/this._itemFullWidth)),l=c*this._itemFullWidth+2*r;if(s=this._scroll.backward?e>this._inner.scrollWidth-l:e+this._width<l,this._opts.onViewItem){var u=n?Math.min(this._items.length-1,i+1):i,d=s?Math.max(0,c-1):c;if(t||u!==this._visible.left||d!==this._visible.right){for(var _=u;_<=d;_++)(this._visible.left<0||t&&!inArray(this._items[_],this._visible.items)||_<this._visible.left||_>this._visible.right)&&this._opts.onViewItem(this._items[_],_);this._visible.left=u,this._visible.right=d,this._visible.items=this._items.slice(u,d+1)}}this._opts.markOutside&&(t?(geByClass("ui_gallery_item_outside",this._inner).forEach((e=>{removeClass(e,"ui_gallery_item_outside")})),this._outside.left=-1,this._outside.right=-1):((i!==this._outside.left||!n)&&this._outside.left>=0&&(removeClass(this._items[this._outside.left],"ui_gallery_item_outside"),this._outside.left=-1),(c!==this._outside.right||!s)&&this._outside.right>=0&&(removeClass(this._items[this._outside.right],"ui_gallery_item_outside"),this._outside.right=-1)),n&&i!==this._outside.left&&(addClass(this._items[i],"ui_gallery_item_outside"),this._outside.left=i),s&&c!==this._outside.right&&(addClass(this._items[c],"ui_gallery_item_outside"),this._outside.right=c))}if(!this._opts.noArrows){var p=e>0,h=e+this._width<this._inner.scrollWidth;toggleClass(this._leftArrow,"ui_gallery__arrow_visible",this._scroll.rtl&&!this._scroll.backward?h:p),toggleClass(this._rightArrow,"ui_gallery__arrow_visible",this._scroll.rtl&&!this._scroll.backward?p:h)}(!this._scroll.backward&&this._inner.scrollWidth-e-this._width<1e3||this._scroll.backward&&e<1e3)&&this._onLoadMore()}_onArrowMouseOver(e){this._opts.noArrows||addClass(this._inner,"ui_gallery__inner_shift_"+e)}_onArrowMouseOut(){this._opts.noArrows||(removeClass(this._inner,"ui_gallery__inner_shift_left"),removeClass(this._inner,"ui_gallery__inner_shift_right"))}_onLoadMore(){!this._opts.onLoadMore||this._loadingMore||this._finised||(this._loadingMore=!0,this._opts.onLoadMore(this._items.length))}addMore(e,t){e=e||[],this.addItems(e),this._finised=!!t||!e.length,this._loadingMore=!1}addItems(e,t){if((e=e||[]).length){var n=t>=0&&t<this._items.length?this._items[t]:null;e.forEach((e=>{n?domInsertBefore(e,n):this._inner.appendChild(e)})),this.refresh()}}destroy(){removeEvent(this._innerCont),removeEvent(this._leftArrow),removeEvent(this._rightArrow),domData(this._el,"gallery-id",null),delete o().galleries[this._id],this._opts.onDestroy&&this._opts.onDestroy(),re(this._el)}removeItem(e){return isNumeric(e)&&(e=this._items[e]),!(!e||!inArray(e,this._items))&&(re(e),this.refresh(),this._items.length||this.destroy(),!0)}refresh(){this._width=getSize(this._el)[0],this._items=geByClass("ui_gallery_item",this._el),this._checkItemsAfterScroll(this._innerCont.scrollLeft,!0)}getItems(){return this._items}getVisibleItems(){return this._visible.items.map(((e,t)=>[e,this._visible.left+t]))}}},65030:(e,t,n)=>{"use strict";n.d(t,{Gifts:()=>l});n(75115);var r=n(86409),o=n(40774),i=n(91587),a=n(62816),s=n(67253);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var l={deleteGift:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};window.ajax.post("al_gifts.php",{act:"delete",mid:r.mid,gift:n,hash:r.hash},{onDone:function(e){var n=ge("gift"+t);n&&(domNS(domFC(n))?domNS(domFC(n)).innerHTML=e:(n.appendChild(ce("div",{className:"gift_deleted",innerHTML:e})),hide(domFC(n)),window.Pagination&&!curBox()&&window.Pagination.recache(-1)))},showProgress:()=>{e.classList.add("gift_delete--loading"),e.innerHTML="",e.appendChild(ce("div",{className:"gift_delete__spinner",innerHTML:(0,a.getIcon16Spinner)().icon}))},hideProgress:()=>{e.classList.remove("gift_delete--loading"),e.innerHTML=(0,s.getIcon16Cancel)().icon}})},restoreGift:function(e,t,n,r){r=r||{},ajax.post("al_gifts.php",{act:"restore",mid:r.mid,gift:n,hash:r.hash},{onDone:function(){var e=ge("gift"+t);e&&domNS(domFC(e))&&(re(domNS(domFC(e))),show(domFC(e)))}})},markSpamGift:function(e,t,n,r){r=r||{},ajax.post("al_gifts.php",{act:"mark_spam",mid:r.mid,gift:n,hash:r.hash},{onDone:function(e){ge("gift_mark_spam"+t).innerHTML=e}})},initGiftsBox:function(e,t){e.setOptions({width:638,bodyStyle:"padding: 0",grey:!0,hideButtons:!0,onShow:function(){cur.gftbxWasScroll&&(boxLayerWrap.scrollTop=cur.gftbxWasScroll,cur.gftbxWasScroll=!1)}}),t.lang&&(cur.lang=extend(cur.lang||{},t.lang)),extend(cur,{gftbxOffset:t.offset,gftbxAutoload:!0,gftbxWasScroll:!1,gftbxMid:t.mid}),ajax.preload("al_gifts.php",{act:"box",mid:t.mid,offset:t.offset},t.preload),window.uiScrollBox&&window.uiScrollBox.init(e,{onShow:function(){addEvent(boxLayerWrap,"scroll",l.onGiftsScroll),setTimeout(cur.chooseAudioScroll,0)},onHide:function(){removeEvent(boxLayerWrap,"scroll",l.onGiftsScroll)}}),addEvent(boxLayerWrap,"scroll",l.onGiftsScroll);var n=boxLayerWrap.scrollTop;elfocus(geByClass1("_scroll_node",e.bodyNode)),boxLayerWrap.scrollTop=n,onBodyResize(),l.onGiftsScroll()},moreGifts:function(){var e=ge("gifts_more_link");(0,r.buttonLocked)(e)||(ajax.post("al_gifts.php",{act:"box",mid:cur.gftbxMid,offset:cur.gftbxOffset},{onDone:function(t,n,r){var o=ce("div",{innerHTML:t}),i=ge("gifts_rows");if(i){for(var a=domFC(o);a;a=domFC(o))i.appendChild(a);cur.gftbxOffset=n,r?l.preloadGifts():hide(e)}},showProgress:r.lockButton.pbind(e),hideProgress:r.unlockButton.pbind(e),cache:1}),cur.gftbxAutoload=!0)},preloadGifts:function(){ajax.post("al_gifts.php",{act:"box",mid:cur.gftbxMid,offset:cur.gftbxOffset},{cache:1})},onGiftsScroll:function(){if(cur.gftbxAutoload){var e=lastWindowHeight,t=ge("gifts_more_link");isVisible(t)&&e>getXY(t,!0)[1]&&t.click()}},showGiftBox:function(e,t,n){return window.Profile?window.Profile.showGiftBox(e,t,n):(cur.gftbxWasScroll=boxLayerWrap.scrollTop,boxLayerWrap.scrollTop=0,cur.viewAsBox?cur.viewAsBox():!showBox("al_gifts.php",{act:"get_gift_box",mid:e,fr:e==vk.id?1:0,ref:n},{stat:["gifts.css","wide_dd.js","wide_dd.css"],cache:1},t))},processBoxOptions(e,t){-1e3!=t&&t&&(extend(cur,{paymentsOfferPreview:t.paymentsOfferPreview,paymentsPreload:t.paymentsPreload,paymentsAppOrder:t.paymentsAppOrder,paymentsOfferPreload:t.paymentsOfferPreload}),t.orderData&&i.AppOrderBox.initialize(t.orderData.orderId,t.orderData.appId,t.orderData.testMode,t.orderData.hash,t.orderData.votes,t.orderData.discount,t.orderData.billPeriod),extend(cur,{paymentsAuthPayment:t.paymentsAuthPayment,paymentsOrderNotice:t.paymentsOrderNotice,paymentsTryCompleteOrder:t.paymentsTryCompleteOrder,isPaymentsAppOrder:t.isPaymentsAppOrder,paymentsOfferApp:t.paymentsOfferApp,checkoutEnabled:t.checkoutEnabled}),t.showProgress&&o.PaymentsBox.showProgress(""),extend(cur,{votesAmountsData:t.votesAmountsData,paymentsPreferVotes:t.paymentsPreferVotes,votesTypeInit:t.votesTypeInit,psList:t.psList,paymentsWideBox:t.paymentsWideBox,paymentsTooltips:t.paymentsTooltips,paymentsChangeType:0===t.paymentsWideBox?getLang("payments_go_change_pay_type"):"",payments_get_votes:getLang("payments_get_votes_new"),getVotesDoneHide:!0,paymentsWaitingCache:{},isPaymentComplete:!1,isPaymentAttemted:!1,usdRate:t.usdRate,paymentsHash:t.paymentsHash,paymentComplete:o.PaymentsBox.complete,paymentCanceled:o.PaymentsBox.paymentCanceled,paymentsShowProgress:o.PaymentsBox.showProgress,statSessionId:t.statSessionId}),o.PaymentsBox.initialize(e),cur.checkoutEnabled||(o.PaymentsBox.initPhoneCountry(t.countries,t.country),o.PaymentsBox.initPhoneNumber(ge("phone"))),extend(cur,{paymentsTypesSum:t.paymentsTypesSum,instantNeedCVV:t.instantNeedCVV,votesType:t.votesType,paymentsWPreload:t.paymentsWPreload}),t.getVotesAmountsOnDone&&o.PaymentsBox.getVotesAmountsOnDone.apply(this,cur.paymentsWPreload))},showGetMoneyBox(){return showBox("al_gifts.php",c({act:"get_money"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:null),{onDone:this.processBoxOptions})}}},87142:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var r=n(3834),o=n(82452),i=n(15544),a=n(95724),s=n(49535);function c(e,t,n){if((0,a.isObject)(t)?n=t:this._dragElClass=t,this.options=(0,a.extend)({dragThreshold:c.DRAG_THRESHOLD_DIST},n),this._contEl=(0,i.ge)(e),this._contEl){this._excludedCount=0;for(var r=0;r<this._contEl.children.length;r++)this._contEl.children[r].getAttribute("nodrag")&&this._excludedCount++;(0,s.addEvent)(this._contEl,"mousedown",this._ev_mousedown_handler=this._onMouseDown.bind(this)),(0,i.setStyle)(this._contEl,"position","relative"),this._inited=!0,this._updateScrollbar=this._initUpdaterScrollbar()}}c.AUTO_SCROLL_DY=10,c.DRAG_THRESHOLD_DIST=0,c.AUTO_SCROLL_DISTANCE_THRESHOLD=300,c.AUTO_SCROLL_GAP=300,c.prototype.destroy=function(){this._inited&&(this._inited=!1,this._deinitEvents(!0))},c.prototype._getParentDragItemEl=function(e){for(var t,n=e;n&&(t=(0,i.domPN)(n))!==this._contEl;)n=t;return n===this._curPlaceholderEl&&(n=null),n},c.prototype._onKey=function(e){e.keyCode===s.KEY.ESC&&this.isCurrentlyDragging()&&this._onMouseUp()},c.prototype._onMouseDown=function(e){if(!(this._disabled||0!=e.button||this._curDragEl||(0,i.attr)(e.target,"nodrag")||this._dragElClass&&!(0,i.domClosest)(this._dragElClass,e.target))){for(var t=e.target;t&&t!==window.document;){if((0,a.intval)((0,i.domData)(t,"nodrag")))return;t=(0,i.domPN)(t)}var n=this._getParentDragItemEl(e.target);if(n&&!(0,i.attr)(n,"nodrag")&&((0,i.re)((0,i.geByClass1)("ui_gridsorter_placeholder"),this._contEl),this._contInfo=this._contInfo||{prevSize:(0,i.getSize)(this._contEl)},this._ensureGridIsActual(),!(this._grid.length<=1))){var r=window.getComputedStyle(n),o=(0,i.getXY)(n);this._initial={candidateEl:n,x:e.clientX,y:e.clientY,itemMargin:{x:parseInt(r.marginLeft),y:parseInt(r.marginTop)},shift:{x:e.pageX-o[0],y:e.pageY-o[1]}},(0,s.addEvent)(document,"mousemove",this._ev_mousemove_handler=this._onMouseMove.bind(this)),(0,s.addEvent)(document,"mouseup",this._ev_mouseup_handler=this._onMouseUp.bind(this)),(0,s.addEvent)(document,"keydown",this._ev_keydown_handler=this._onKey.bind(this)),cur.cancelClick=!1,(0,s.cancelEvent)(e)}}},c.prototype._dist=function(e){return Math.abs(e.clientX-this._initial.x)+Math.abs(e.clientY-this._initial.y)},c.prototype._onMouseUp=function(e){var t=this._curDragEl,n=!e;if(this._curDragEl){this._curDragEl=null,(0,i.removeClass)(t,"ui_gridsorter_moveable_notrans"),this._curOverCell||(this._curOverCell={el:this._curPlaceholderEl,pos:(0,i.getXY)(this._curPlaceholderEl),size:(0,i.getSize)(this._curPlaceholderEl)});var r=this._curOverCell.pos,o=this._curOverCell.el,a=this._grid[this._curDragCellIndex],c=a&&a.size;(0,i.gpeByClass)("_ape_item_list",t)&&(r[0]+=20,r[1]+=20),c&&this._isShiftToLeft&&(r[1]-=c[1]-this._curOverCell.size[1]),setTimeout((()=>{if(n){for(var e=0,o=this._grid.length;e<o;e++){var i=this._grid[e];i.dirty&&this._setPos(i.el,{left:0,top:0})}this._setPos(t,this._initialCurDragPos)}else this._setPos(t,{left:r[0],top:r[1]})})),setTimeout((()=>{if((0,i.re)(this._curPlaceholderEl),(0,i.removeClass)(this._contEl,"ui_gridsorter_cont"),this.options.dragCls&&(0,i.removeClass)(t,this.options.dragCls),this._inited){var e;if(n){for(var r=this._grid.length,a=0;a<r;a++){var s=this._grid[a];s.dirty&&this._setPos(s.el,{left:null,top:null})}this._setPos(t,{left:null,top:null,width:null,height:null})}else{var c;e=this._isShiftToLeft?(0,i.domNS)(o):o,this._contEl.insertBefore(t,e);var l=-1,u=this._initial.hasInlineSize;this._setPos(t,{left:null,top:null}),u||(0,i.setStyle)(t,{width:null,height:null});for(var d=this._grid.length,_=0;_<d;_++){var p=this._grid[_];(p.dirty||p.el===t)&&(this._setPos(p.el,{left:null,top:null}),u||(0,i.setStyle)(p.el,{width:null,height:null}),p.pos=this._calcElementPos(p.el),p.dirty=!1),p.el===t?c=_:p.el===o&&(l=_)}if(l>=0){var h=this._grid.splice(c,1);this._grid.splice(l,0,h[0])}}(0,i.removeClass)(t,"ui_gridsorter_moveable"),this._curOverCell=this._curPlaceholderEl=null,n&&this.update(),this.options.onDragFinish&&this.options.onDragFinish(t),o!==t&&!n&&this.options.onReorder&&this.options.onReorder(t,e,(0,i.domPS)(t))}}),210),e&&this._dist(e)>5&&((0,s.cancelEvent)(e),cur.cancelClick=!0)}this._updateScrollbar(),this._deinitEvents(),t&&this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,t),n||t&&this._overEl&&this.options.onDragDrop&&(n=this.options.onDragDrop(this._overEl,t)),this._overEl=null},c.prototype._deinitEvents=function(e){e&&(this._onMouseUp(),(0,s.removeEvent)(this._contEl,"mousedown",this._ev_mousedown_handler)),clearTimeout(this._autoScrollTO),this._autoScrollTO=!1,this._ev_mousemove_handler&&(0,s.removeEvent)(document,"mousemove",this._ev_mousemove_handler),this._ev_mouseup_handler&&(0,s.removeEvent)(document,"mouseup",this._ev_mouseup_handler),this._ev_keydown_handler&&(0,s.removeEvent)(document,"keydown",this._ev_keydown_handler)},c.prototype._setPos=function(e,t){this.options.noPosTransform||!this._hasTranslateFeauture&&!(this._hasTranslateFeauture=window.getComputedStyle(e).getPropertyValue("transform"))?(0,i.setStyle)(e,(0,a.extend)({transform:null},t)):null===t.left||null===t.top?(0,i.setStyle)(e,{transform:null,top:null,left:null}):(0,i.setStyle)(e,{transform:"translate("+t.left+"px, "+t.top+"px)",top:null,pos:null})},c.prototype._recalc=function(){var e=this._curDragEl,t=this._curOverCell.el;if(this._initGrid(),t!==e){for(var n=0,r=!1,o=!1,i=this._grid.length,a=0;a<i;a++){var s=this._grid[a];if(s.el===e){r=!0;break}if(s.el===t){r=!1;break}}this._isShiftToLeft=r;for(var c=r?0:this._grid.length-1,l=r?this._grid.length:-1,u=r?1:-1,d=[0,0];c!==l;c+=u){var _=this._grid[c];if(2!==n)if(_.el!==e){if(_.el===t&&n++,1===n||2===n){var p=0,h=0;r?(p=o.pos[0]+d[0],h=o.pos[1]+d[1],d[0]+=_.size[0]-o.size[0],d[1]+=_.size[1]-o.size[1]):(d[0]+=o.size[0]-_.size[0],d[1]+=o.size[1]-_.size[1],p=o.pos[0]+d[0],h=o.pos[1]+d[1]),this._setPos(_.el,{left:p-_.pos[0],top:h-_.pos[1]}),_.dirty=!0}else _.dirty&&(this._setPos(_.el,{left:null,top:null}),_.dirty=!1);o=_}else n++,o=_;else _.dirty&&(this._setPos(_.el,{left:null,top:null}),_.dirty=!1),o=_}}else for(var f=this._grid.length,m=0;m<f;m++){var g=this._grid[m];g.el!==e&&g.dirty&&(g.dirty=!1,this._setPos(g.el,{left:null,top:null}))}},c.prototype.disable=function(){this._disabled=!0},c.prototype.enable=function(){this._disabled=!1,this._initGrid(!0)},c.prototype.update=function(){this._disabled||this._initGrid(!0)},c.prototype._ensureGridIsActual=function(){this._initGrid()},c.prototype._needGridUpdate=function(){if(!this._grid)return 1;this._contInfo.prevSize=this._contInfo.prevSize||(0,i.getSize)(this._contEl);var e=0,t=this._contEl.children.length-this._excludedCount-(0,a.intval)(!!this._curPlaceholderEl);if(t!==this._grid.length)e=t>this._grid.length?2:1,this._contInfo.prevSize=(0,i.getSize)(this._contEl);else{var n=(0,i.getSize)(this._contEl),r=this._contInfo.prevSize;(Math.abs(r[0]-n[0])>5||Math.abs(r[1]-n[1])>5)&&(e=1),this._contInfo.prevSize=n}return e},c.prototype._initGrid=function(e){var t=e?1:this._needGridUpdate();if(t){1===t&&(this._grid=[],this._contInfo&&(delete this._contInfo.pos,delete this._contInfo.size));var n=this._grid?this._grid[this._grid.length-1]:null;this._grid=this._grid||[];var r,o=!!n,a=this._contEl.children;if(a.length)for(var s=this._getItemMargins(),c=this._curDragEl?this._grid.length:0,l=a.length;c<l;c++){var u=a[c];n&&u===n.el?o=!1:o||u===this._curPlaceholderEl||u.getAttribute("nodrag")||((r=(0,i.getSize)(u))[0]+=s[0],r[1]+=s[1],this._grid.push({el:u,size:r,pos:this._calcElementPos(u)}))}}},c.prototype._getRelativeMousePos=function(e){var t=this._getContPos(),n=this._getContShift();return{left:e.clientX-t[0]-n[0],top:e.clientY-t[1]-n[1]}},c.prototype._updateDraggablePosition=function(e){if(this._curDragEl){var t=this._getRelativeMousePos(e),n=this._getItemShift(),r=this._getContShift(),o=this._getContSize(),a=t.top-this._initial.shift.y-n[1]+r[1];this.options.limitBottomMove&&(a=Math.min(a,o[1]+30)),(0,i.hasClass)(this._contEl,"_ape_item_list")&&(a+=this._contEl.scrollTop),this._setPos(this._curDragEl,{left:t.left-this._initial.shift.x-n[0]+r[0],top:a}),window.AudioPage&&window.AudioPage.onUpdateDraggablePosition&&window.AudioPage.onUpdateDraggablePosition()}},c.prototype._getContShift=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.shift){var e=window.getComputedStyle(this._contEl);this._contInfo.shift=[parseFloat(e.paddingLeft),parseFloat(e.paddingTop)]}return this._contInfo.shift},c.prototype._getContSize=function(){return this._contInfo=this._contInfo||{},this._contInfo.size=(0,i.getSize)(this._contEl),this._contInfo.size},c.prototype._getContPos=function(){return this._contInfo=this._contInfo||{},this._contInfo.pos=(0,i.getXY)(this._contEl),this._contInfo.pos[1]-=(0,r.scrollGetY)(),this._contInfo.pos},c.prototype._getItemShift=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.itemShift){var e=window.getComputedStyle((0,i.domFC)(this._contEl));this._contInfo.itemShift=[parseFloat(e.marginLeft),parseFloat(e.marginTop)]}return this._contInfo.itemShift},c.prototype._getItemMargins=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.itemMargins){var e=window.getComputedStyle((0,i.domFC)(this._contEl));this._contInfo.itemMargins=[parseFloat(e.marginLeft)+parseFloat(e.marginRight),parseFloat(e.marginTop)+parseFloat(e.marginBottom)]}return this._contInfo.itemMargins},c.prototype._calcElementPos=function(e){var t=this._getContShift(),n=this._getItemShift();return[e.offsetLeft-t[0]-n[0],e.offsetTop-t[1]-n[1]]},c.prototype.isCurrentlyDragging=function(){return!!this._curDragEl},c.prototype._initUpdaterScrollbar=function(){return(0,o.throttle)((e=>{var t=this.options.wrapNode||e,n=(0,i.data)(t,"sb");n&&n.update(!1,!0)}),500)},c.prototype._onMouseMove=function(e){var t=()=>this.options.wrapNode?this.options.wrapNode.scrollTop:(0,r.scrollGetY)(),n=e=>{this.options.wrapNode?this.options.wrapNode.scrollTop=e:(0,r.scrollToY)(e,0,!1,!0)};if(this._curDragEl){this._ensureGridIsActual(),!e&&(e={clientX:this._lastMousePos.x,clientY:this._lastMousePos.y}),this._lastMousePos={x:e.clientX,y:e.clientY},this._updateDraggablePosition(e);var o=this._getContSize(),a=this._getRelativeMousePos(e),c=!1;if((0,i.hasClass)(this._contEl,"_ape_item_list")&&(a.top+=this._contEl.scrollTop),a.left>0&&a.left<o[0]&&a.top>0&&a.top<o[1])for(var l=0,u=this._grid.length-1,d=50;d;){var _=l+Math.floor((u-l)/2),p=this._grid[_];if(a.left>p.pos[0]&&a.top>p.pos[1]&&a.left<p.pos[0]+p.size[0]&&a.top<p.pos[1]+p.size[1]){c=p;break}if(l===u)break;a.top<p.pos[1]||a.left<p.pos[0]&&a.top<p.pos[1]+p.size[1]?u=u===_?u-1:_:l=l===_?l+1:_,d--}else{for(var h,f,m,g=this._grid.length,v=999999,y=0;y<g;y++){var E=this._grid[y],w=(f=a.left-(E.pos[0]+E.size[0]/2))*f+(m=a.top-(E.pos[1]+E.size[1]/2))*m;v>w&&(v=w,h=E)}c=h}!c||this._curOverCell&&this._curOverCell.el===c.el||(this._curOverCell=c,this._recalc());var b,C,S,T,D=0;if(this.options.wrapNode)b=T=this.options.wrapNode,C=(0,i.getSize)(b),(S=(0,i.getXY)(b))[1]-=(0,r.scrollGetY)(),D=e.clientY;else{var P=window,A=document.documentElement,k=document.getElementsByTagName("body")[0],I=P.innerWidth||A.clientWidth||k.clientWidth,O=P.innerHeight||A.clientHeight||k.clientHeight;T=P.bodyNode,C=[I,O],S=[0,0],D=e.clientY}var x=Math.max(20,C[1]/10),R=S[1]+x-D,M=x-(S[1]+C[1]-D);if(M>0||R>0){var L=Math.min(1,R/x),N=Math.min(1,M/x);this._autoScrollTO||(this._autoScrollTO=setTimeout((()=>{this._autoScrollTO=!1;var e=t();n(e+16*(L>0?-L:N)),e!==T.scrollTop&&(this._updateScrollbar(T),this._onMouseMove())}),20))}if(this.options.onDragOverElClass){var B=e.target;(0,i.hasClass)(B,this.options.onDragOverElClass)||(B=(0,i.gpeByClass)(this.options.onDragOverElClass,B))?this._overEl!==B&&(this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,this._curDragEl),this.options.onDragEnter&&this.options.onDragEnter(B,this._curDragEl),this._overEl=B):(this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,this._curDragEl),this._overEl=null)}}else if(this._dist(e)>this.options.dragThreshold){this._curDragEl=this._initial.candidateEl;for(var U=this._grid.length,F=0;F<U;F++)if(this._grid[F].el===this._curDragEl){this._curDragCellIndex=F;break}this.options.dragCls&&(0,i.addClass)(this._curDragEl,this.options.dragCls);var W=(0,i.getSize)(this._curDragEl),j=(0,i.getXY)(this._curDragEl),V=window.getComputedStyle(this._curDragEl),H=this._getContPos();this._initial.hasInlineSize=!(!this._curDragEl.style.width&&!this._curDragEl.style.height),(0,i.setStyle)(this._curDragEl,{width:W[0],height:W[1]}),this._initialCurDragPos={left:j[0]-H[0],top:j[1]-H[1]-bodyNode.scrollTop},this._curPlaceholderEl=(0,i.ce)("div",{className:"ui_gridsorter_placeholder"}),(0,i.setStyle)(this._curPlaceholderEl,{width:W[0]+parseFloat(V.marginLeft)+parseFloat(V.marginRight),height:W[1]+parseFloat(V.marginTop)+parseFloat(V.marginBottom)}),this._contEl.insertBefore(this._curPlaceholderEl,this._curDragEl),(0,i.addClass)(this._curDragEl,"ui_gridsorter_moveable"),(0,i.addClass)(this._curDragEl,"ui_gridsorter_moveable_notrans"),(0,i.addClass)(this._contEl,"ui_gridsorter_cont"),this._onMouseMove(e),this._updateDraggablePosition(e),this.options.onDragStart&&this.options.onDragStart(this._curDragEl)}(0,s.cancelEvent)(e)};const l=c},1261:(e,t,n)=>{"use strict";n.d(t,{default:()=>u});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767);var r=n(15544),o=n(3834),i=n(96547);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c="page_header_cont",l="onboarding";class u{constructor(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.el=e,this.text=t,this.hideDarkness=!0,this.oldColor=!1;var o,i,a={autoShow:!1,noAutoHideOnWindowClick:null===(n=r.noAutoHideOnWindowClick)||void 0===n||n,content:t instanceof HTMLElement?t:`${t}`,cls:`feature_intro_tt tutorial_tip_tt ${i=null!==(o=r.class)&&void 0!==o?o:"",r.tooltipWhite?i:i+" feature_intro_blue_tt"}`,appendToParent:!0,onHide:this.ttOnHide.bind(this),scrollOffset:r.scrollOffset||0,align:r.align||window.ElementTooltip.ALIGN_CENTER};r.side&&(a.forceSide=r.side),r.offset&&(a.offset=r.offset),r.width&&(a.width=r.width),r.shift&&(a.centerShift=r.shift),r.border?this.border=r.border:this.border=[10,10,10,10],r.ttOnHide&&(a.onHide=r.ttOnHide),r.withCloseButton&&(a.withCloseButton=r.withCloseButton,a.onCloseButtonClick=r.onCloseButtonClick),r.align&&(a.align=r.align),this.ttParams=a,this.opts=r,this.initOnboardingBG()}initOnboardingBG(){if(!window.onboardingBG){var e=se('\n<div id="onboarding_layout">\n  <svg id="onboarding_bg_header" width="100%" height="49px">\n    <rect id="onboarding_bg_rect" class="GroupOnboardingBg" x="0" y="0" width="100%" height="100%" fill-opacity="0.8" fill="#000"></rect>\n  </svg>\n  <svg id="onboarding_bg" width="100%" height="100%">\n  <defs>\n    <mask id="mask" x="0" y="0" width="100%" height="100%">\n      <rect x="0" y="0" width="100%" height="100%" fill="#fff"></rect>\n      <rect id="onboarding_bg_clip" class="GroupOnboardingBgClip" x="0" y="0" width="0" height="0" fill="#000" rx="8" ry="8"></rect>\n    </mask>\n  </defs>\n  <rect id="onboarding_bg_rect" class="GroupOnboardingBg" x="0" y="42" width="100%" height="100%" mask="url(#mask)" fill-opacity="0.8"></rect>\n  </svg>\n</div>\n      ');(0,r.domInsertBefore)(e,window.layerBG),window.onboardingBGHeader=ge("onboarding_bg_header"),window.onboardingBG=ge("onboarding_bg"),window.onboardingBGRect=ge("onboarding_bg_rect"),window.onboardingBGClip=ge("onboarding_bg_clip"),window.cur.destroy.push((()=>{hide(window.onboardingBG),hide(window.onboardingBGHeader),removeClass(ge(c),l),this.hideDarkness=!0,this.hideTT(),delete window.onboardingBG,delete window.onboardingBGHeader,delete window.onboardingBGRect,delete window.onboardingBGClip,this.opts.onBGClick&&removeEvent(window.onboardingBG,"click",this.opts.onBGClick)})),this.opts.onBGClick&&addEvent(window.onboardingBG,"click",this.opts.onBGClick)}}showTT(){var e=a((0,r.getXY)(this.el),2)[1];this.tt=new window.ElementTooltip(this.el,this.ttParams),this.opts.highlight&&(this.addDarkness(),this.addHighlight()),this.tt.show();var t=this.tt.getContent();(0,i.isElementInViewport)(this.el)&&(0,i.isElementInViewport)(t)||(0,o.scrollToY)(e-42-this.ttParams.scrollOffset)}hideTT(){this.tt&&(this.opts.onHide&&this.opts.onHide(),this.tt.destroy(),this.removeDarkens(),this.hideDarkness&&(removeEvent(window,"scroll"),removeEvent(window,"resize")))}addHighlight(){window.onboardingBGClip&&(this.highlightElement(),addEvent(window,"scroll",this.onScrollTT.bind(this)),addEvent(window,"resize",this.onResizeTT.bind(this)))}highlightElement(){var e=this.el.offsetWidth,t=this.el.offsetHeight,n=(0,r.getXY)(this.el);attr(window.onboardingBGClip,"width",e+this.border[1]+this.border[3]),attr(window.onboardingBGClip,"height",t+this.border[0]+this.border[2]),attr(window.onboardingBGClip,"x",n[0]-this.border[1]),attr(window.onboardingBGClip,"y",n[1]-this.border[0])}onResizeTT(){this.setDartToFullWidth(),this.highlightElement()}onScrollTT(){var e=this.getPageHeight();window.onboardingBG.height!=e&&this.setDartToFullHeight()}setDartToFullHeight(){attr(window.onboardingBG,"height",this.getPageHeight())}setDartToFullWidth(){attr(window.onboardingBG,"width",this.getPageWidth()),attr(window.onboardingBGHeader,"width",this.getPageWidth())}addDarkness(){(0,r.isVisible)(window.onboardingBG)||(this.setDartToFullHeight(),this.setDartToFullWidth(),show(window.onboardingBG),(0,r.isVisible)(window.onboardingBGHeader)||(show(window.onboardingBGHeader),addClass(ge(c),l)))}removeDarkens(){this.hideDarkness&&(hide(window.onboardingBG),hide(window.onboardingBGHeader),removeClass(ge(c),l))}ttOnHide(){this.hideTT()}show(){setTimeout(this.showTT.bind(this),1e3)}getPageWidth(){var e=document.documentElement,t=document.body;return Math.max(t.scrollWidth,e.scrollWidth,t.offsetWidth,e.offsetWidth,t.clientWidth,e.clientWidth)}getPageHeight(){var e=document.documentElement,t=document.body;return Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,t.clientHeight,e.clientHeight)}}},96547:(e,t,n)=>{"use strict";function r(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}n.d(t,{isElementInViewport:()=>r})},49030:(e,t,n)=>{"use strict";function r(e){var t=e.getBoundingClientRect(),n=document.body,r=document.documentElement,o=window.pageYOffset||r.scrollTop||n.scrollTop,i=window.pageXOffset||r.scrollLeft||n.scrollLeft,a=r.clientTop||n.clientTop||0,s=r.clientLeft||n.clientLeft||0;return{top:Math.round(t.top+o-a),left:Math.round(t.left+i-s),width:e.offsetWidth,height:e.offsetHeight}}n.d(t,{default:()=>r})},15949:(e,t,n)=>{"use strict";n.d(t,{showQuickLoginBox:()=>r,showJoinBox:()=>o});n(59357),n(89988),n(86409),n(54612),n(76852),n(86067),n(95724),n(15544),n(70488),n(55349),n(85048),n(59367);function r(){return showBox("al_login.php",{act:"box"}),!1}function o(){return showBox("join.php",{act:"box",from:window.nav.strLoc}),!1}},76270:(e,t,n)=>{"use strict";n.d(t,{hasAccessibilityMode:()=>l,updateOnlineText:()=>u,updateAriaCheckboxes:()=>d,updateAriaElements:()=>p,makeInteractiveMVKA11yProposal:()=>h});var r=n(86409),o=n(95724),i=n(15544),a=n(86067),s=n(26271),c=n(79957);function l(){return!(!window.vk||!vk.a11y)}function u(){clearTimeout(cur.updateOnlineTO),cur.updateOnlineTO=setTimeout((function(){(0,o.each)((0,i.geByClass)("_online"),(function(){var e=(0,i.geByClass1)("_online_reader",this)||this,t=(0,i.hasClass)(this,"online"),n=(0,i.hasClass)(this,"mobile"),r=(0,i.geByTag)("img",e),s=function(e){var t=(0,i.domClosest)("_post",e),n=t&&(0,i.domByClass)(t,"author");return n?n.innerText||n.textContent:""};if(t){var c="";(0,o.each)(r,(function(){var e=(0,i.attr)(this,"alt")||(0,i.attr)(this,"data-alt")||s(this);e&&(c=(0,o.trim)(c+" "+e),this.setAttribute("data-alt",e),this.removeAttribute("alt"))})),c=(0,o.trim)(c+" "+(n?(0,a.getLang)("global_user_is_online_mobile"):(0,a.getLang)("global_user_is_online"))),e.setAttribute("aria-label",c)}else(0,o.each)(r,(function(){var e=(0,i.attr)(this,"data-alt")||s(this);e&&(this.setAttribute("alt",e),this.removeAttribute("data-alt"))})),e.removeAttribute("aria-label")}))}),100)}function d(){clearTimeout(cur.updateChkBoxTO),cur.updateChkBoxTO=setTimeout((function(){var e=[];(0,o.each)(["checkbox","checkbox_pic"],(function(){e=e.concat((0,i.geByClass)(this))})),(0,o.each)(e,(function(){"DIV"!==this.tagName||this.getAttribute("role")||(this.setAttribute("role","checkbox"),this.setAttribute("aria-checked",(0,r.isChecked)(this)?"true":"false"),this.setAttribute("tabindex",0))}))}),100)}function _(){clearTimeout(cur.updateRadioBtnsTO),cur.updateRadioBtnsTO=setTimeout((function(){var e=[],t=(0,i.geByClass)("radiobtn");(0,o.each)(t,(function(){if("DIV"===this.tagName&&!this.getAttribute("role")){var t=(0,r.isChecked)(this);this.setAttribute("role","radio"),this.setAttribute("aria-checked",t?"true":"false"),this.setAttribute("tabindex",t?0:-1);var n=function(e){var t=5,n=0,r=e;for(;n<t&&r!==document;){if(r=(0,i.domPN)(r),(0,i.geByClass)("radiobtn",r).length>1)break;n++}return r}(this);~e.indexOf(n)||e.push(n)}})),(0,o.each)(e,(function(){if(!(0,i.geByClass)("on",this).length){var e=(0,i.geByClass)("radiobtn",this);e.length&&e[0].setAttribute("tabindex",0)}}))}),100)}function p(){u(),d(),_()}function h(){var e=document.getElementById("a11y_mvk_proposal");e&&e.getAttribute("aria-label")&&!e.getAttribute("role")&&(e.setAttribute("role","link"),e.style.display="block",e.classList.add("visually-hidden"),e.addEventListener("click",(e=>{var t;(0,c.statlogsValueEvent)("accessibility","is_mvk_proposal_clicked",null===(t=cur)||void 0===t?void 0:t.module),setTimeout((()=>{(0,s.redirectToMVK)()}),100)}),{passive:!0}))}},78273:(e,t,n)=>{"use strict";n.d(t,{updSeenAdsInfo:()=>a,__adsUpdate:()=>c,initAds:()=>d});var r=n(76567),o=n(95724),i=n(15544);function a(){if(((0,i.getXY)("ads_left",!0)||{})[1]&&vk.id){var e=(0,i.getXYRect)((0,i.geByTag1)("ol",(0,i.ge)("side_bar_inner")),!0),t=e?e.height:0,n=(0,i.getXYRect)((0,i.ge)("left_blocks"),!0),a=n?n.height:0,s=Math.max(Math.floor(((window.lastWindowHeight||0)-t-a-42-10)/260),0),c=(0,r.getCookie)("remixseenads");window.__seenAds=(0,o.intval)(c),c&&__seenAds===s||(window.__seenAds=s,(0,r.setCookie)("remixseenads",s,30))}}function s(e,t){return!window.noAdsAtAll&&(s=function(){return window.AdsLight&&AdsLight.getAjaxParams.apply(AdsLight.getAjaxParams,arguments)||{al_ad:null}},window.AdsLight?n=s(e,t):(n={al_ad:null},stManager.add([jsc("web/ads_light.js")],s.pbind(e,t))),n);var n}function c(e){if(window.noAdsAtAll)return!1;c=function(){window.AdsLight&&AdsLight.updateBlock.apply(AdsLight.updateBlock,arguments)},stManager.add([jsc("web/ads_light.js")],c.pbind(e))}function l(e,t,n,r,o,i){if(window.noAdsAtAll)return!1;l=function(){var e="";arguments&&arguments[0]&&(e=arguments[0]),"\x3c!--criteo"===e.slice(0,"\x3c!--criteo".length)&&Math.random()<.05&&(window.AdsLight&&AdsLight.setNewBlock?ajax.post("/wkview.php?act=mlet&mt=750",{},{onFail:()=>!0}):ajax.post("/wkview.php?act=mlet&mt=751",{},{onFail:()=>!0})),window.AdsLight&&AdsLight.setNewBlock.apply(AdsLight.setNewBlock,arguments)},stManager.add([jsc("web/ads_light.js")],l.pbind(e,t,n,r,o,i))}function u(e){if(window.noAdsAtAll)return!1;u=function(){window.AdsLight&&AdsLight.updateExternalStats.apply(AdsLight.updateExternalStats,arguments)},stManager.add([jsc("web/ads_light.js")],u.pbind(e))}function d(){window.__seenAds=(0,o.intval)((0,r.getCookie)("remixseenads")),window.__adsUpdate=c,window.__adsSet=l,window.__adsGetAjaxParams=s,window.__adsUpdateExternalStats=u}window.__adsLoaded=(0,o.vkNow)()},96011:(e,t,n)=>{"use strict";n.d(t,{requestBox:()=>o,activateMobileBox:()=>i,validateMobileBox:()=>a,validatePassBox:()=>s,validateOtpBox:()=>c});var r=n(54612);function o(e,t,n){return e.setOptions({onDestroy:n}),e.onDone=function(){t&&t.apply(null,arguments)},e}function i(e){return o((0,r.showBox)("activation.php",{act:"activate_mobile_box",hash:e.hash}),(function(){vk.nophone=0,e.onDone()}),e.onFail)}function a(e){return o((0,r.showBox)("activation.php",{act:"validate_box",captcha:e.acceptCaptcha?1:"",skip_push:e.skip_push?e.skip_push:"",from:e.from||"",hash:e.hash,ahash:e.ahash},{stat:["uncommon.css"]}),e.onDone,e.onFail)}function s(e){return o((0,r.showBox)("activation.php",{act:"pass_validate_box",hash:e.hash},{stat:["uncommon.css"]}),e.onDone,e.onFail)}function c(e){return o((0,r.showBox)("activation.php",{act:"otp_validate_box",hash:e.hash},{stat:["uncommon.css"]}),e.onDone,e.onFail)}},86125:(e,t,n)=>{"use strict";n.d(t,{curBox:()=>l,initBoxQueue:()=>u,boxRefreshCoords:()=>d,showDoneBox:()=>_,showDoneBoxFull:()=>p,getAndCleanBoxQueueData:()=>f,restoreBoxQueue:()=>m});n(75115);var r=n(49535),o=n(95724),i=n(15544),a=n(26271);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var c={hideAll:function(e,t){if(e)for(;c.count();)c.hideLast();else{if(c.count()){var n=_message_boxes[c._boxes.pop()];n&&(n._in_queue=!1,n._hide(!1,!1,t))}for(;c.count();){_message_boxes[c._boxes.pop()]._in_queue=!1}}},hideLast:function(e,t){if(c.count()){var n=window._message_boxes[c._boxes[c.count()-1]];if(!0===e&&(n.changed||n.preventHideLastWithCheck||c.skip||t&&t.target&&t.target.tagName&&"input"!==t.target.tagName.toLowerCase()&&cur.__mdEvent&&t.target!==cur.__mdEvent.target))return void(c.skip=!1);n.hide()}if(t&&"click"===t.type)return(0,r.cancelEvent)(t)},hideBGClick:function(e){e&&e.target&&/^box_layer/.test(e.target.id)&&c.hideLast()},count:function(){return c._boxes.length},_show:function(e){var t=_message_boxes[e];if(t&&!t._in_queue){c.count()?_message_boxes[c._boxes[c.count()-1]]._hide(!0,!0):window.tooltips&&tooltips.hideAll(),t._in_queue=!0;var n=!!c.count();n&&(n=c._boxes.every((e=>!!_message_boxes[e]&&!_message_boxes[e].forceHide))),c.curBox=e,t._show(n||c.currHiding,n),c._boxes.push(e)}},_hide:function(e){var t=_message_boxes[e];if(t&&t._in_queue&&c._boxes[c.count()-1]===e&&t.isVisible()&&(t._in_queue=!1,c._boxes.pop(),t._hide(!!c.count()),c.count())){var n=c._boxes[c.count()-1];c.curBox=n,_message_boxes[n]._show(!0,!0,!0)}},_boxes:[],curBox:0};function l(){var e=window._message_boxes[window.boxQueue.curBox];return e&&e.isVisible()?e:null}function u(){window.boxQueue=c,window.__bq=c,window.curBox=l,window.boxQueue.hideLastCheck=window.boxQueue.hideLast.pbind(!0),window._message_box_guid=0,window._message_boxes=[]}function d(e){var t=window.innerHeight||document.documentElement.clientHeight||boxLayerBG.offsetHeight,n=a.browser.mobile?(0,o.intval)(window.pageYOffset):0,r=(0,i.getSize)(e);e.style.marginTop=Math.max(10,n+(t-r[1])/3)+"px"}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};window.Notifier?h(e,t,n):window.stManager.add(["notifier.js","notifier.css"],(()=>{h(e,t,n)}))}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s({},n,{type:"done_box_full"});_(e,t,r)}function h(e,t,n){window.curNotifier&&window.curNotifier.version||window.Notifier.init({version:-1,instance_id:-1});var r=void 0!==t.onHide?t.onHide:t.callback,o=void 0!==t.timeout?t.timeout:void 0!==t.out?t.out:null,i=null!==t.id&&void 0!==t.id?t.id:++window.curNotifier.showDoneBoxLastId,a=s({version:window.curNotifier.version,type:"done_box",text:e,onclick:t.onClick,top_count:-1,id:i,timeout:o,onHide:r,preventHideByClick:!0,link:t.link},n);t.tooltipHandler&&(a.tooltipHandler=t.tooltipHandler),Notifier.pushEvent(a)}function f(){var e={boxes:window._message_boxes,boxQueueIds:window.boxQueue._boxes,curBoxId:window.boxQueue.curBox};return window.boxQueue._boxes=[],window._message_boxes=[],window.boxQueue.curBox=0,e}function m(e){window._message_boxes=e.boxes,window.boxQueue._boxes=e.boxQueueIds,window.boxQueue.curBox=e.curBoxId}},75632:(e,t,n)=>{"use strict";n.d(t,{cancelStackFilter:()=>o,cancelStackPush:()=>i,cancelStackPop:()=>a});var r=n(89433);function o(e,t){var n=window.cancelStack||[];return t&&(0,r.topHeaderClearClose)(),window.cancelStack=n.filter((t=>t.name!==e)),window.cancelStack}function i(e,t,n){return n&&(0,r.topHeaderClose)((function(){t(),o(e)})),window.cancelStack=o(e).concat([{func:t,name:e,dclick:n}]),window.cancelStack}function a(e){var t=window.cancelStack||[];(0,r.topHeaderClearClose)(),t.length>0&&t.pop().func(e);var n=t[t.length-1];return n&&n.dclick&&(0,r.topHeaderClose)((function(){n.func(e),o(n.name)})),window.cancelStack=t,window.cancelStack}},89988:(e,t,n)=>{"use strict";n.d(t,{isToday:()=>r,isYesterday:()=>o,isTomorrow:()=>i,isSameDate:()=>a,leadingZero:()=>s,formatTime:()=>c,getServerTime:()=>l,getLastDay:()=>u});n(86067),n(95724);function r(e){var t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function o(e){return r(new Date(e.getTime()+864e5))}function i(e){return r(new Date(e.getTime()-864e5))}function a(e,t){var n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function s(e){return e>=10?e:"0"+e}function c(e,t){var n;e=Math.max(e,0);var r=Math.floor(e%60);n=r<10?"0"+r:r;var o=(e=Math.floor(e/60))%60;return n=o+":"+n,((e=Math.floor(e/60))>0||t)&&(o<10&&(n="0"+n),n=e+":"+n),n}function l(){return vk.ts+Math.floor(((new Date).getTime()-vk.started)/1e3)}function u(e,t){return 2==+t?function(e){return(e=parseInt(e))%4==0&&e%100!=0||e%400==0}(e)?29:28:t>0&&(t<8&&t%2==0||t>7&&t%2==1)?30:31}},87481:(e,t,n)=>{"use strict";n.d(t,{initDebugTools:()=>s,logEvalError:()=>c,debugLog:()=>l,debugEl:()=>u});n(66108),n(96253),n(59357);var r=n(26271),o=n(19331),i=n(66433);function a(){if((0,o.partConfigEnabled)("log_fetch_requests")){var e=(e,t)=>{try{if(~e.indexOf("/al_audio")||~e.indexOf("/like.php"))throw new Error(t)}catch(e){(0,i.debugBufferLog)(e)}};!function(e){var t=window.XMLHttpRequest;window.XMLHttpRequest=function(){var n,r,i=new t,a=i.open,s=i.send;return i.open=function(){var e=Array.prototype.slice.call(arguments);return r=e[0],n=e[1],a.apply(i,arguments)},i.send=function(){var t=arguments[0];return("POST"===(r=(r||"").toUpperCase())||"GET"===r&&(0,o.partConfigEnabled)("log_fetch_requests_get"))&&e(n,[r,n,t].join(":")),s.apply(i,arguments)},i},["DONE","HEADERS_RECEIVED","LOADING","OPENED","UNSENT"].forEach((e=>{Object.defineProperty(window.XMLHttpRequest,e,{enumerable:!1,configurable:!1,writable:!1,value:t[e]})}))}(e),window.fetch&&function(e){var t=window.fetch;window.fetch=function(){for(var n=new Array(arguments.length),r=0;r<n.length;++r)n[r]=arguments[r];var o,i=n[0],a="GET";"string"==typeof i?o=i:"Request"in window&&i instanceof window.Request?(o=i.url,i.method&&(a=i.method)):o=""+i,n[1]&&n[1].method&&(a=n[1].method);var s={method:a,url:o,status_code:null};return e(o,o),t.apply(this,n).then((function(e){return s.status_code=e.status,e})).catch((function(e){throw e}))}}(e)}}function s(){window._logTimer=(new Date).getTime(),a()}function c(e,t){if(window.Raven){if(t&&t.length>2e3){var n=t.indexOf("; window.TimeSpent && TimeSpent.setTimers && TimeSpent.setTimers(");~n&&(t=t.slice(0,n)),t=`${t.slice(0,1e3)}...${t.slice(-1e3)}`}e.message+=`: ${t}`,(0,i.logError)(e)}}function l(e){try{window.debuglogClient&&debuglogClient(e);var t="["+((new Date).getTime()-window._logTimer)/1e3+"] ";if(window.console&&console.log){var n=Array.prototype.slice.call(arguments);n.unshift(t),r.browser.msie||r.browser.mobile?console.log(n.join(" ")):console.log.apply(console,n)}}catch(e){}}function u(e){if(!e)return!1;var t=e.tagName,n=e.id,r=e.className,o=(t||"").toLowerCase();return r&&(o+="."+e.className.replace(/\s+/g,".")),n&&!/^__vk/.test(n)&&(o+=`#${e.id}`),o||(e.toString()||"[NULL]")}},15544:(e,t,n)=>{"use strict";n.d(t,{$:()=>s,$$:()=>c,emptyNode:()=>l,ge:()=>u,geByTag:()=>d,geByTag1:()=>_,geByClass:()=>p,geByClass1:()=>h,gpeByClass:()=>f,domQuery:()=>m,domQuery1:()=>g,domClosest:()=>v,domClosestByTag:()=>y,ce:()=>E,cf:()=>T,re:()=>D,domEL:()=>P,domNS:()=>A,domPS:()=>k,domFC:()=>I,domLC:()=>O,domPN:()=>x,se:()=>R,sech:()=>M,rs:()=>L,domReplaceEl:()=>N,domChildren:()=>B,domInsertBefore:()=>U,domInsertAfter:()=>F,domByClass:()=>W,domData:()=>j,domChildIndex:()=>V,domCA:()=>H,domClosestSibling:()=>K,matchesSelector:()=>G,isHover:()=>z,isAncestor:()=>q,getScroll:()=>$,domClosestPositioned:()=>Y,domClosestOverflowHidden:()=>Q,show:()=>X,hide:()=>J,isVisible:()=>Z,clientHeight:()=>ee,getClientRectOffsetY:()=>te,toggle:()=>ne,boundingRectEnabled:()=>re,getXYRect:()=>oe,getXY:()=>ie,isWindow:()=>ae,getSize:()=>se,getW:()=>ce,getH:()=>le,hasClass:()=>ue,addClass:()=>de,addClassDelayed:()=>_e,removeClass:()=>pe,removeClassDelayed:()=>he,toggleClass:()=>fe,toggleClassDelayed:()=>me,replaceClass:()=>ge,getStyle:()=>ve,setStyle:()=>ye,data:()=>Ee,attr:()=>we,removeAttr:()=>be,removeData:()=>Ce,cleanElems:()=>Se,setTitle:()=>Te,getZoom:()=>De,val:()=>Pe,elfocus:()=>Ae,traverseParent:()=>ke,setDocumentTitle:()=>Oe,lockDocumentTitle:()=>xe,initDomScripts:()=>Re});n(51876),n(21466),n(66108),n(96253),n(83946),n(59357);var r=n(95724),o=n(49535),i=n(26271),a=n(87481);function s(e,t){return(t||document).querySelector(e)}function c(e,t){return(t||document).querySelectorAll(e)}function l(e){if(e)for(;e.firstChild;)e.removeChild(e.firstChild)}var u=e=>"string"==typeof e||"number"==typeof e?document.getElementById(e):e;function d(e,t){return(t=u(t)||document).getElementsByTagName(e)}function _(e,t){return(t=u(t)||document).querySelector&&t.querySelector(e)||d(e,t)[0]}function p(e,t,n){return t=u(t)||document,n=n||"*",e=("."+e).replace(/\s+/gm,"."),Array.prototype.slice.call(t.querySelectorAll(n+e))}function h(e,t,n){return n=n||"*",(t=u(t)||document).querySelector&&t.querySelector(n+("."+e).replace(/\s+/gm,"."))||p(e,t,n)[0]}function f(e,t,n){if(!(t=u(t)))return null;for(;n!==t&&(t=t.parentNode);)if(ue(t,e))return t;return null}function m(e,t){return(t||document).querySelectorAll(e)}function g(e,t){return(t||document).querySelector(e)}function v(e,t){return ue(t,e)?t:f(e,t)}function y(e,t){return e=e.toUpperCase(),t.nodeType===Node.ELEMENT_NODE&&t.tagName.toUpperCase()===e?t:function(e,t){if(!(t=u(t)))return null;e=e.toUpperCase();for(;t=t.parentNode;)if(t.tagName&&t.tagName.toUpperCase()===e)return t;return null}(e,t)}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=document.createElement(e);return t&&(0,r.extend)(o,t),n&&ye(o,n),o}var w,b,C,S,T=(w=document,b=w.createDocumentFragment(),C=w.createElement("div"),S=w.createRange&&w.createRange(),b.appendChild(C),S&&S.selectNodeContents(C),S&&S.createContextualFragment?e=>e?S.createContextualFragment(e):w.createDocumentFragment():e=>{if(!e)return w.createDocumentFragment();C.innerHTML=e;for(var t=w.createDocumentFragment();C.firstChild;)t.appendChild(C.firstChild);return t});function D(e){return(e=u(e))&&e.parentNode&&e.parentNode.removeChild(e),e}function P(e,t){for(t=t?"previousSibling":"nextSibling";e&&!e.tagName;)e=e[t];return e}var A=e=>P((e||{}).nextSibling),k=e=>P((e||{}).previousSibling,1),I=e=>P((e||{}).firstChild),O=e=>P((e||{}).lastChild,1),x=e=>(e||{}).parentNode,R=e=>I(E("div",{innerHTML:e})),M=e=>B(E("div",{innerHTML:e}));function L(e,t){return(0,r.each)(t,(function(t,n){e=e.replace(new RegExp("%"+t+"%","g"),(void 0===n?"":n).toString().replace(/\$/g,"&#036;"))})),e}function N(e,t){return(0,r.isString)(t)&&(t=R(t)),x(e).replaceChild(t,e),t}function B(e){for(var t=[],n=e.childNodes,r=0;r<n.length;r++)n[r].tagName&&t.push(n[r]);return t}function U(e,t){var n=x(t);return n&&n.insertBefore(e,t)}function F(e,t){var n=x(t);return n&&n.insertBefore(e,A(t))}function W(e,t){return e?h(t,e):e}function j(e,t,n){return e?void 0!==n?(null===n?e.removeAttribute("data-"+t):e.setAttribute("data-"+t,n),n):e.getAttribute("data-"+t):null}function V(e){for(var t=0;null!=(e=k(e));)t++;return t}function H(e,t){do{e=x(e)}while(e&&!G(e,t));return e}function K(e,t,n){for(var r=null;null===r&&e;)(e=-1===n?k(e):A(e))&&G(e,t)&&(r=e);return r}function G(e,t){if(!(e=u(e))||e===document)return!1;var n=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1};return n.call(e,t)}function z(e){return G(e,":hover")}function q(e,t){var n=u(e);if(t=u(t),!e||!t)return!1;for(;n=n.parentNode;)if(n===t)return!0;return!1}function $(){var e=i.browser.msie6?u("PageContainer"):document.body,t=document.documentElement;return[e.scrollLeft||t.scrollLeft||window.pageXOffset||0,e.scrollTop||t.scrollTop||window.pageYOffset||0,t.clientWidth||e.clientWidth||0,t.clientHeight||e.clientHeight||0]}function Y(e,t){for(var n=(t=t||{}).fromEl||x(e),o=t.positions||["relative","absolute","fixed"];n&&n!==bodyNode;){var i=ve(n,"position");if((0,r.inArray)(i,o)&&(!t.noOverflow||"hidden"!==ve(n,"overflow")))break;n=x(n)}return n}function Q(e,t){for(var n,r,o,a=e=u(e),s=!1;a&&a.tagName&&a!==bodyNode;){if(n=ve(a,"position"),r=ve(a,"overflow"),o=ve(a,"transform"),t&&i.browser.mozilla){if("page_wrap"!=a.id&&a!==e&&"visible"!==r&&("static"===n?!s||"relative"===s:"fixed"!==s))break}else if(a!==e&&"visible"!==r&&("static"===n?!s||"relative"===s:"fixed"!==s))break;"none"!==o?s=void 0:"static"!==n&&"fixed"!==s&&(s=n),a=x(a)}return a}function X(e){var t=arguments.length;if(t>1)for(var n=0;n<t;n++)X(arguments[n]);else if((e=u(e))&&e.style){var r=e.olddisplay,o=e.tagName.toLowerCase(),a="block";e.style.display=r||"","none"===ve(e,"display")&&(a=ue(e,"inline")||ue(e,"_inline")?"inline":ue(e,"_inline_block")?"inline-block":"tr"!==o||i.browser.msie?"table"!==o||i.browser.msie?"block":"table":"table-row",e.style.display=e.olddisplay=a)}}function J(e){var t=arguments.length;if(t>1)for(var n=0;n<t;n++)J(arguments[n]);else if((e=u(e))&&e.style){var r=ve(e,"display");e.olddisplay="none"!==r?r:"",e.style.display="none"}}function Z(e){return!(!(e=u(e))||!e.style)&&"none"!==ve(e,"display")}function ee(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function te(e,t,n){n=n||0;var o=ie(e=u(e))[1],i=se(e)[1],a=window,s=document.documentElement,c=Math.max((0,r.intval)(a.innerHeight),(0,r.intval)(s.clientHeight)),l=u("page_header_cont"),d=s.scrollTop||bodyNode.scrollTop||window.scrollY||0,_=vk.staticheader?Math.max(0,se(l)[1]-d):se(l)[1];if(t){if(o+i<d+_+n)return o+i-d-_-n;if(o>d+c-n)return o-d-c+n}else{if(o<d+_+n)return o-d-_-n;if(o+i>d+c-n)return o+i-d-c+n}return 0}function ne(e,t){return void 0===t&&(t=!Z(e)),t?X(e):J(e),t}function re(e){return void 0!==e.getBoundingClientRect}function oe(e,t){var n;if(t&&"inline"===ve(e,"display")){var r=e.getClientRects();n=r&&r[0]||e.getBoundingClientRect()}else n=e.getBoundingClientRect();return n}function ie(e,t){if(!(e=u(e)))return[0,0];var n=e.ownerDocument,r={top:0,left:0};if(!n)return[0,0];var o=n.documentElement;re(e)&&(r=oe(e,!0));var i=n===n.window?n:9===n.nodeType&&(n.defaultView||n.parentWindow);return[r.left+(t?0:i.pageXOffset||o.scrollLeft)-(o.clientLeft||0),r.top+(t?0:i.pageYOffset||o.scrollTop)-(o.clientTop||0)]}function ae(e){return null!=e&&e===e.window}function se(e,t,n){e=u(e);var o,i=document.documentElement,a=[0,0];if(t&&"border-box"===ve(e,"boxSizing")&&(t=!1),e===document)a=[Math.max(i.clientWidth,bodyNode.scrollWidth,i.scrollWidth,bodyNode.offsetWidth,i.offsetWidth),Math.max(i.clientHeight,bodyNode.scrollHeight,i.scrollHeight,bodyNode.offsetHeight,i.offsetHeight)];else if(e){function i(){a=re(e)&&(o=oe(e,n))&&void 0!==o.width?[o.width,o.height]:[e.offsetWidth,e.offsetHeight],t&&(0,r.each)(a,(function(t,n){var o=t?["Top","Bottom"]:["Left","Right"];(0,r.each)(o,(function(){a[t]-=parseFloat(ve(e,"padding"+this))||0,a[t]-=parseFloat(ve(e,"border"+this+"Width"))||0}))}))}if(Z(e))i();else{var s={position:"absolute",visibility:"hidden",display:"block"},c={},l=!1;e.style.cssText.indexOf("!important")>-1&&(l=e.style.cssText),(0,r.each)(s,(function(t,n){c[t]=e.style[t],e.style[t]=n})),i(),(0,r.each)(s,(function(t,n){e.style[t]=c[t]})),l&&(e.style.cssText=l)}}return a}function ce(e){return se(e)[0]}function le(e){return se(e)[1]}function ue(e,t){var n=u(e);return n&&n.classList&&n.classList.contains(t)}function de(e,t){var n=u(e);n&&n.classList&&(t.includes(" ")?` ${n.className} `.includes(` ${t} `)||(n.className=(n.className?`${n.className} `:"")+t):t.length&&!n.classList.contains(t)&&n.classList.add(t))}var _e=(e,t,n)=>{n=(0,r.positive)(n),setTimeout(de.pbind(e,t),n)};function pe(e,t){var n=u(e);t.length&&n&&n.classList&&n.classList.contains(t)&&n.classList.remove(t)}var he=(e,t,n)=>{n=(0,r.positive)(n),setTimeout(pe.pbind(e,t),n)};function fe(e,t,n){var r=u(e);if(!t.length||!r||!r.classList)return!1;if(void 0===n)return r.classList.toggle(t);var o=r.classList.contains(t);return n&&!o?r.classList.add(t):!n&&o&&r.classList.remove(t),n}function me(e,t,n,o){return o=(0,r.positive)(o),void 0===n&&(n=!ue(e,t)),(n?_e:he)(e,t,o),n}function ge(e,t,n){pe(e,t),de(e,n)}function ve(e,t,n){if(e=u(e),(0,r.isArray)(t)){var o={};return(0,r.each)(t,((t,n)=>o[n]=ve(e,n))),o}if(!e)return"";if(void 0===n&&(n=!0),!n&&"opacity"===t&&i.browser.msie){var a=e.style.filter;return a?a.indexOf("opacity=")>=0?parseFloat(a.match(/opacity=([^)]*)/)[1])/100+"":"1":""}if(!n&&e.style&&(e.style[t]||"height"===t))return e.style[t];var s,c=document.defaultView||window;if(c.getComputedStyle){t=t.replace(/([A-Z])/g,"-$1").toLowerCase();var l=c.getComputedStyle(e,null);l&&(s=l.getPropertyValue(t))}else if(e.currentStyle){if("opacity"===t&&i.browser.msie){var d=e.currentStyle.filter;return d&&d.indexOf("opacity=")>=0?parseFloat(d.match(/opacity=([^)]*)/)[1])/100+"":"1"}var _=t.replace(/\-(\w)/g,(function(e,t){return t.toUpperCase()}));"auto"===(s=e.currentStyle[t]||e.currentStyle[_])&&(s=0),s=(s+"").split(" "),(0,r.each)(s,(function(t,n){if(!/^\d+(px)?$/i.test(n)&&/^\d/.test(n)){var r=e.style,o=r.left,i=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,r.left=n||0,s[t]=r.pixelLeft+"px",r.left=o,e.runtimeStyle.left=i}})),s=s.join(" ")}if(n&&("width"===t||"height"===t)){var p=se(e,!0)[{width:0,height:1}[t]];s=((0,r.intval)(s)?Math.max((0,r.floatval)(s),p):p)+"px"}return s}function ye(e,t,n){if(e=u(e))if((0,r.isObject)(t))(0,r.each)(t,((t,n)=>ye(e,t,n)));else if("opacity"===t)i.browser.msie&&((n+"").length?e.style.filter=1!==n?"alpha(opacity="+100*n+")":"":e.style.cssText=e.style.cssText.replace(/filter\s*:[^;]*/gi,""),e.style.zoom=1),e.style.opacity!==n&&(e.style.opacity=n);else try{var o="number"==typeof n;o&&/height|width/i.test(t)&&(n=Math.abs(n)),n=o&&!/z-?index|font-?weight|opacity|zoom|line-?height/i.test(t)?n+"px":n,e.style[t]!==n&&(e.style[t]=n)}catch(e){(0,a.debugLog)("setStyle error: ",[t,n],e)}}function Ee(e,t,n){if(!e)return!1;var r=e[vkExpand];return r||(r=e[vkExpand]=++vkUUID),void 0!==n&&(vkCache[r]||(vkCache[r]={},window.__debugMode&&(vkCache[r].__elem=e)),vkCache[r][t]=n),t?vkCache[r]&&vkCache[r][t]:r}function we(e,t,n){return e=u(e),void 0===n?e.getAttribute(t):(e.setAttribute(t,n),n)}function be(e){for(var t=0,n=arguments.length;t<n;++t){var r=arguments[t];if(void 0!==e[r])try{delete e[r]}catch(t){try{e.removeAttribute(r)}catch(e){}}}}function Ce(e,t){var n=!!e&&e[vkExpand];if(n)if(t){if(vkCache[n]){delete vkCache[n][t],t="";var r=0;for(var i in vkCache[n])if("__elem"!==i){r++;break}r||Ce(e)}}else(0,o.removeEvent)(e),be(e,vkExpand),delete vkCache[n]}function Se(){for(var e=arguments,t=0;t<e.length;++t){var n=u(e[t]);n&&(Ce(n),be(n,"btnevents"))}}function Te(e,t,n){if((e=u(e))&&!e.titleSet){if(t||(t=e),t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)e.setAttribute("title",n||e.innerText||e.textContent);else{var r=_("b",e);r&&(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)?e.setAttribute("title",n||e.innerText||e.textContent):e.removeAttribute("title")}e.titleSet=1}}function De(){var e=u("zoom_test_1")||document.body.appendChild(E("div",{id:"zoom_test_1"},{left:"10%",position:"absolute",visibility:"hidden"}));return(u("zoom_test_2")||document.body.appendChild(E("div",{id:"zoom_test_2"},{left:e.offsetLeft+"px",position:"absolute",visibility:"hidden"}))).offsetLeft/e.offsetLeft}function Pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(e=u(e))return void 0!==t&&(e.setValue?(e.setValue(t),!n&&e.phonblur&&e.phonblur()):"INPUT"===e.tagName||"TEXTAREA"===e.tagName?e.value=t:void 0!==e.emojiId&&window.Emoji?Emoji.val(e,t):e.innerHTML=t,!n&&(0,o.triggerEvent)(e,"valueChanged")),e.getValue?e.getValue():("INPUT"===e.tagName||"TEXTAREA"===e.tagName?e.value:e.innerHTML)||""}function Ae(e,t,n){e=u(e);try{if(e.focus(),void 0!==t&&!1!==t||(t=e.value.length),void 0!==n&&!1!==n||(n=t),e.setSelectionRange)e.setSelectionRange(t,n);else if(window.getSelection&&document.createRange){var r=document.createRange();r.selectNodeContents(e),r.collapse(!1);var o=window.getSelection();o.removeAllRanges(),o.addRange(r)}}catch(e){}}function ke(e,t,n){for(e=u(e),n=n||999;e&&!t(e);){if(0===--n)return!1;try{if((e=x(e))===document)return!1}catch(t){e=!1}}return e}window.cssTransformProp=function(){var e=document.createElement("div");if(null==e.style.transform){var t=["Webkit","Moz","ms"];for(var n in t)if(void 0!==e.style[t[n]+"Transform"])return t[n]+"Transform"}return"transform"}();var Ie=!1;function Oe(e){if(!Ie)return window.document.title=(0,r.replaceEntities)(e)}function xe(e){Ie=e,e&&window.cur&&window.cur.destroy.push((()=>{xe(!1)}))}function Re(){window.vkExpand=window.vkExpand||"VK"+(0,r.vkNow)(),window.vkUUID=window.vkUUID||0,window.vkCache=window.vkCache||{}}},49535:(e,t,n)=>{"use strict";n.d(t,{KEY:()=>a,addEvent:()=>s,removeEvent:()=>c,triggerEvent:()=>l,cancelEvent:()=>u,stopEvent:()=>d,normEvent:()=>p,checkEvent:()=>h,checkKeyboardEvent:()=>f,checkOver:()=>m});n(30522),n(51876);var r=n(15544),o=n(95724),i=n(26271),a={LEFT:37,UP:38,RIGHT:39,DOWN:40,DEL:8,TAB:9,RETURN:13,ENTER:13,ESC:27,PAGEUP:33,PAGEDOWN:34,SPACE:32,CTRL:17,ALT:18,SHIFT:16};function s(e,t,n,i,a,s){if((e=(0,r.ge)(e))&&3!=e.nodeType&&8!=e.nodeType){var c,l=a?((c=function(e){var t=e.data;e.data=a;var r=n.apply(this,[e]);return e.data=t,r}).handler=n,c):n;e.setInterval&&e!==window&&(e=window);var u=(0,r.data)(e,"events")||(0,r.data)(e,"events",{}),d=(0,r.data)(e,"handle")||(0,r.data)(e,"handle",function(e){return function(){_.apply(e,arguments)}}(e));(0,o.each)(t.split(/\s+/),(function(t,n){u[n]||(u[n]=[],!i&&e.addEventListener?e.addEventListener(n,d,s):!i&&e.attachEvent&&e.attachEvent("on"+n,d)),u[n].push(l)}))}}function c(e,t,n,i){if(void 0===i&&(i=!1),e=(0,r.ge)(e)){var a=(0,r.data)(e,"events");if(a)if("string"==typeof t)(0,o.each)(t.split(/\s+/),(function(t,s){if((0,o.isArray)(a[s])){var c=a[s].length;if((0,o.isFunction)(n)){for(var l=c-1;l>=0;l--)if(a[s][l]&&(a[s][l]===n||a[s][l].handler===n)){a[s].splice(l,1),c--;break}}else{for(var u=0;u<c;u++)delete a[s][u];c=0}c||(e.removeEventListener?e.removeEventListener(s,(0,r.data)(e,"handle"),i):e.detachEvent&&e.detachEvent("on"+s,(0,r.data)(e,"handle")),delete a[s])}})),(0,o.isEmpty)(a)&&((0,r.removeData)(e,"events"),(0,r.removeData)(e,"handle"));else for(var s in a)a.hasOwnProperty(s)&&c(e,s)}}function l(e,t,n,i){e=(0,r.ge)(e);var a=(0,r.data)(e,"handle");if(a){var s=()=>a.call(e,(0,o.extend)(n||{},{type:t,target:e}));i?s():setTimeout(s,0)}}function u(e){if(!(e=e||window.event))return!1;for(;e.originalEvent;)e=e.originalEvent;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}function d(e){if(!(e=e||window.event))return!1;for(;e.originalEvent;)e=e.originalEvent;return e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,!1}function _(e){e=p(e);var t=Array.from(arguments);t[0]=e;var n=(0,r.data)(this,"events");if(n&&"string"==typeof e.type&&n[e.type]&&n[e.type].length){var o=(n[e.type]||[]).slice();for(var i in o)if(o.hasOwnProperty(i)){if("mouseover"===e.type||"mouseout"===e.type){for(var a=e.relatedElement;a&&a!==this;)a=a.parentNode;if(a===this)continue}var s=o[i].apply(this,t);if(!1!==s&&-1!==s||u(e),-1===s)return!1}}}function p(e){var t=e=e||window.event;if((e=(0,o.clone)(t)).originalEvent=t,e.target||(e.target=e.srcElement||document),3==e.target.nodeType&&(e.target=e.target.parentNode),!e.relatedTarget&&e.fromElement&&(e.relatedTarget=e.fromElement===e.target),null==e.pageX&&null!=e.clientX){var n=document.documentElement,r=bodyNode;e.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n.clientLeft||0),e.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n.clientTop||0)}return!e.which&&(e.charCode||0===e.charCode?e.charCode:e.keyCode)&&(e.which=e.charCode||e.keyCode),!e.metaKey&&e.ctrlKey?e.metaKey=e.ctrlKey:!e.ctrlKey&&e.metaKey&&i.browser.mac&&(e.ctrlKey=e.metaKey),!e.which&&e.button&&(e.which=1&e.button?1:2&e.button?3:4&e.button?2:0),e}function h(e){var t=e||window.event;return t&&("click"===t.type||"mousedown"===t.type||"mouseup"===t.type)&&(t.which>1||t.button>1||t.ctrlKey||t.shiftKey||i.browser.mac&&t.metaKey)||!1}function f(e){if(!(e=p(e))||!e.target)return!1;if(!e.screenX)return!0;var t=(0,r.getSize)(e.target),n=(0,r.getXY)(e.target),o=e.pageX-n[0],i=e.pageY-n[1];return o<-1||o>t[0]+1||i<-1||i>t[1]+1||Math.abs(e.pageX-n[0]-t[0]/2)<1&&Math.abs(e.pageY-n[1]-t[1]/2)<1}function m(e,t){if(!e)return!0;e=e.originalEvent||e,t=t||e.target;var n=e.fromElement||e.relatedTarget;if(!n||n===t||n===t.parentNode)return!0;for(;n!==t&&n.parentNode&&n.parentNode!==bodyNode;)n=n.parentNode;return n!==t}},67784:(e,t,n)=>{"use strict";n.d(t,{addDelegateEvent:()=>s,removeDelegateEvent:()=>c});n(30522),n(66108),n(79665),n(95767),n(91181),n(96253),n(51876);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i=new window.Map;function a(e){var t=i.get(e.currentTarget);if(t){var n=t[e.type];if(n)for(var o,a=0;a<n.length;a++){var s=r(n[a],2),c=s[0],l=s[1],u=void 0;if(hasClass(e.target,c)?u=l(e,e.target):(o=gpeByClass(c,e.target,e.currentTarget))&&(u=l(e,o)),!1===u)break}}}function s(e,t,n,r,o){var s=i.get(e);s||(i.set(e,{}),s=i.get(e));for(var c=t.split(" "),l=0;l<c.length;l++){var u=c[l];s[u]||(s[u]=[],o?addEvent(e,u,a,!1,!1,o):addEvent(e,u,a)),s[u].push([n,r])}}function c(e,t,n,r){var o=i.get(e);o&&(t.split(" ").forEach((t=>{o[t]&&(o[t]=o[t].filter((e=>e[0]!==n||e[1]!==r)),0===o[t].length&&removeEvent(e,t,a))})),0===Object.keys(o).map((e=>o[e].length)).reduce(((e,t)=>e+t))&&i.delete(e))}},35093:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{menuSettings:()=>menuSettings,showSettingsAddressBox:()=>showSettingsAddressBox,showWriteMessageBox:()=>showWriteMessageBox,giftsBox:()=>giftsBox,moneyTransferBox:()=>moneyTransferBox,reportAd:()=>reportAd,mobilePromo:()=>mobilePromo,showAudioClaimWarning:()=>showAudioClaimWarning,sureDeleteAll:()=>sureDeleteAll,imageStatusPopup:()=>imageStatusPopup});var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(75115),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(59357),_message_box__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(54612),_ui__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(86409),_dom__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(15544),_dom_events__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(49535),_lang__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(86067),_debug_tools__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(87481),_box_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(86125),_shared_lib_web_stats__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(71516),_shared_user_user_env__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(19331),_web_payments_money_transfer__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(62857),_web_settings_addressBox__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(73166);function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(this,arguments)}function menuSettings(e){return(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showTabbedBox)("al_settings.php",{act:"menu_box",type:e})}function showSettingsAddressBox(){(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("al_settings.php",{act:"adress_box"},{stat:[jsc("web/settings.js"),"settings.css"],params:{bodyStyle:"padding: 0;",hideButtons:!0},onDone(e,t){var n=t.hash;(0,_web_settings_addressBox__WEBPACK_IMPORTED_MODULE_12__.initSettingsAddressBox)(n)}})}function showWriteMessageBox(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};cur.onFriendMessage&&cur.onFriendMessage(),stManager.add(["page.js","wide_dd.js"]);var r=(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("al_im.php",_extends({act:"a_write_box",to:t},n.params),{stat:[jsc("web/writebox.js"),"writebox.css","wide_dd.css","page.css","post.css",jsc("web/emoji.js"),"notifier.css"],cache:1},e);return r&&(0,_dom_events__WEBPACK_IMPORTED_MODULE_5__.cancelEvent)(e),window.WriteBox&&WriteBox.extractEmoji(),!r}function giftsBox(e,t,n){return cur.viewAsBox?cur.viewAsBox():!(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("al_gifts.php",{act:"box",tab:n||"received",mid:e},{cache:1,stat:["gifts.css",jsc("web/gifts.js")]},t)}function moneyTransferBox(e,t,n,r,o,i,a){if(cur.viewAsBox)return cur.viewAsBox();if(o){var s,c;if(!a)return 2===o?(s=cur.lang&&cur.lang.mail_money_transfer_cancel_confirm||(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("mail_money_transfer_cancel_confirm"),c=cur.lang&&cur.lang.mail_money_transfer_cancel_btn||(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("mail_money_transfer_cancel_btn")):(s=cur.lang&&cur.lang.mail_money_transfer_decline_confirm||(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("news_fb_money_transfer_decline_confirm"),c=cur.lang&&cur.lang.mail_money_transfer_decline_btn||(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("news_fb_money_transfer_decline_btn")),void(cur.confirmBox=(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_action_confirmation"),s,c,moneyTransferBox.pbind(e,t,n,r,o,!1,1),(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_cancel")));var l=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.hasClass)((0,_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(r),"wall_postlink_preview_btn")||(0,_dom__WEBPACK_IMPORTED_MODULE_4__.hasClass)(r,"money_transfer__decline_button"),u=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass1)("flat_button",(0,_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(r));return 2!==a&&((0,_ui__WEBPACK_IMPORTED_MODULE_3__.disableButton)(u,!0),l?((0,_dom__WEBPACK_IMPORTED_MODULE_4__.addClass)(r.firstChild,"round_spinner"),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.removeClass)(r.firstChild,"button")):(0,_ui__WEBPACK_IMPORTED_MODULE_3__.lockButton)(r),cur.confirmBox&&cur.confirmBox.hide()),void ajax.post("al_payments.php?act=a_cancel_money_transfer",{tx_id:e,hash:t,from:l?"snippet":""},{onDone:function(i,a,s){0!==i?(l?((0,_dom__WEBPACK_IMPORTED_MODULE_4__.re)(r),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.hasClass)(u,"secondary")||(0,_dom__WEBPACK_IMPORTED_MODULE_4__.domReplaceEl)(u,s)):(0,_dom__WEBPACK_IMPORTED_MODULE_4__.re)((0,_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(r)),(0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.showDoneBox)(a),window.TopNotifier.invalidate()):setTimeout(moneyTransferBox.pbind(e,t,n,r,o,!1,2),2e3)},onFail:function(e){return(0,_ui__WEBPACK_IMPORTED_MODULE_3__.disableButton)(u,!1),l?((0,_dom__WEBPACK_IMPORTED_MODULE_4__.addClass)(r.firstChild,"button"),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.removeClass)(r.firstChild,"round_spinner")):(0,_ui__WEBPACK_IMPORTED_MODULE_3__.unlockButton)(r),setTimeout((0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_error"),e).hide,2e3),!0}})}return cur.acceptMoneyBtn=r,i?!_web_payments_money_transfer__WEBPACK_IMPORTED_MODULE_11__.MoneyTransfer.showMoneyTransferBox({request_id:e,request:i,hash:t},{stat:["payments.css",jsc("workers/payments.js")]},(e=>((0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.curBox)()&&(0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.curBox)().hide(),setTimeout((0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_error"),e).hide,2e3),!0))):!(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("al_payments.php",{act:"accept_money_transfer_box",tx_id:e,hash:t},{stat:["payments.css",jsc("workers/payments.js")],onFail:e=>((0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.curBox)()&&(0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.curBox)().hide(),setTimeout((0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_error"),e).hide,2e3),!0),onDone(e,t){_web_payments_money_transfer__WEBPACK_IMPORTED_MODULE_11__.MoneyTransfer.initHandlers(),window.cur=extend(window.cur,{paymentsOptions:t,paymentsPopupWrite(e){e.document.innerHTML!=cur._popup_text&&(e.document.write(window.cur._popup_text),e.document.close(),e.blur(),e.focus(),window.cur._popup_callback&&window.cur._popup_callback())}}),e.setOptions({width:510,bodyStyle:"padding: 0;",hideButtons:!0,onClean(){window.cur.moneyTranferCheckInt&&clearInterval(window.cur.moneyTranferCheckInt),window.removeEventListener("message",_web_payments_money_transfer__WEBPACK_IMPORTED_MODULE_11__.MoneyTransfer.frameMessage,!1)}}),_web_payments_money_transfer__WEBPACK_IMPORTED_MODULE_11__.MoneyTransfer.initAccept(t.chkData,t.frame)}},n)}function reportAd(e,t){if((0,_shared_user_user_env__WEBPACK_IMPORTED_MODULE_10__.partConfigEnabled)("ads_new_reports_web_tgb")){var n="",r=null,o=(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("/reports.php",{act:"report_ad_box",ad_data:t},{onDone:function(){var e=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("radiobtn","ad_report");window.radioBtns.ad_report={val:0,els:e};var t=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ge)("ad_csrf");n=t?t.value:n,r=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ge)("ad_comment")},params:{width:370,onClean:()=>{delete window.radioBtns.ad_report}},stat:["reports.css"]});o.removeButtons(),o.addButton((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("box_send"),(i=>{ajax.post("reports.php",{act:"a_report_ad",ad_id:e,reason:window.radioBtns.ad_report.val,comment:r?r.value:"",ad_data:t,hash:n},{onDone:()=>{o.hide(),(0,_box_utils__WEBPACK_IMPORTED_MODULE_8__.showDoneBox)((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("reports_thanks_for_report"))},showProgress:()=>(0,_ui__WEBPACK_IMPORTED_MODULE_3__.lockButton)(i),hideProgress:()=>(0,_ui__WEBPACK_IMPORTED_MODULE_3__.unlockButton)(i)})})),o.addButton((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_cancel"),!1,"no")}else(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("/reports.php?act=a_report_ad_box",{ad_id:e},{params:{width:370},stat:["ui_controls.js","ui_controls.css"]})}var mobilePromo=_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox.pbind("al_login.php",{act:"mobile",box:1});function showAudioClaimWarning(e,t,n){var r,o,i=e.id,a=e.ownerId,s=e.title,c=t.id,l=t.reason,u=t.original,d={width:470};if(e.restrictionStatus)return AudioUtils.showAudioRestriction(e);"geo"===l?(r=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claimed_geo"),o=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_warning_title")):"site_rules_violation"===l?(r=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_site_rules_violation_warning"),o=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_site_rules_violation_header")):"replace"===l?(r=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claimed_replacement_available"),o=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_warning_title")):"subscription"===l?(d.hideButtons=!0,d.bodyStyle="padding: 0; border-radius: 4px;",d.width=450,o=!1,r=`\n      <div class="audio_claim_popup">\n        <div class="audio_claim_popup__title">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_audio_only_with_subscription_title")}</div>\n        <div class="audio_claim_popup__text">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_audio_only_with_subscription_text")}</div>\n        <div class="audio_claim_popup__close" onclick="curBox().hide()"></div>\n        <button class="flat_button round_button" onclick="AudioPlayer.showSubscriptionPopup()">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_audio_only_with_subscription_btn")}</button>\n      </div>`):(r=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_warning"),o=(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_warning_title")),d.title=o;var _=[d,r=(r=(r=r.replace(/\{audio\}/g,`<b>${s}</b>`)).replace(/\{objection_link\}/g,`<a href="/help?act=cc_objection&claim=${c}&content=audio${a}_${i}">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_objection")}</a>`)).replace(/\{delete_link\}/g,`<a onclick="deleteAudioOnClaim(${a}, ${i}); return false;">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_delete")}</a>`)],p=null;if(n&&u){var h=AudioUtils.drawAudio(u,"no_extra");_[1]=r.replace(/\{original\}/g,u[AudioUtils.AUDIO_ITEM_INDEX_PERFORMER]+" - "+u[AudioUtils.AUDIO_ITEM_INDEX_TITLE])+"<br/><br/>"+h,_.push((0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_replace_with_original"),(function(){(0,_ui__WEBPACK_IMPORTED_MODULE_3__.lockButton)(p.btns.ok[0]),n((()=>p.hide()))})),d.textControls=`<a onclick="deleteAudioOnClaim(${a}, ${i}); return false;">${(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("audio_claim_delete_capital")}</a>`}cur.claimWarning=p=_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox.apply(null,_)}function sureDeleteAll(title,text,where,objectId,toId,fromId,hash,event){if(!(0,_dom_events__WEBPACK_IMPORTED_MODULE_5__.checkEvent)(event)){var box=(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showFastBox)({title:title},text,(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_delete"),(function(btn){ajax.post("/delete_all.php",{act:where,object_id:objectId,to_id:toId,from_id:fromId,hash:hash,loc:nav.objLoc[0]},{onDone:function onDone(res){if(__debugMode)eval(res);else try{eval(res)}catch(e){(0,_debug_tools__WEBPACK_IMPORTED_MODULE_7__.logEvalError)(e,res)}box.hide()},showProgress:_ui__WEBPACK_IMPORTED_MODULE_3__.lockButton.pbind(btn),hideProgress:_ui__WEBPACK_IMPORTED_MODULE_3__.unlockButton.pbind(btn)})}),(0,_lang__WEBPACK_IMPORTED_MODULE_6__.getLang)("global_cancel"));return!1}}function imageStatusPopup(e,t){Object.assign(t,{act:"image_status"});var n=(0,_message_box__WEBPACK_IMPORTED_MODULE_2__.showBox)("special_event.php",t,{containerClass:"ImageStatusPopup__container",params:{hideButtons:!0},onFail:function(){return window.cur.imageStatusBox&&window.cur.imageStatusBox.hide(),!0},onDone:function(e,t){var n=t.status_id;n&&(0,_shared_lib_web_stats__WEBPACK_IMPORTED_MODULE_9__.saveStatlogEvents)({name:"image_status",value:n,keys:["show_popup"]})}},e);n&&((0,_dom_events__WEBPACK_IMPORTED_MODULE_5__.cancelEvent)(e),window.cur.imageStatusBox=n)}},50167:(e,t,n)=>{"use strict";n.d(t,{initTopNotifier:()=>b,isPhotoeditor3Available:()=>C,showPhoto:()=>S,showManyPhoto:()=>T,showAlbums:()=>D,showAlbum:()=>P,showPhotoTags:()=>A,showVideoTags:()=>k,videoCallback:()=>I,showAttachProductBox:()=>O,showWiki:()=>x,showApp:()=>R,showPodcast:()=>M,podcastStartFrom:()=>L,articlePrepare:()=>N,openArticleEditor:()=>B,bookmark:()=>U,bookmarkPost:()=>F,bookmarkArticle:()=>W,bookmarkLink:()=>j,bookmarkPodcast:()=>V,bookmarkNarrative:()=>G,bookmarkEvent:()=>z,bookmarkYoulaProduct:()=>q,shareAudioPlaylist:()=>$,getAudioPlayer:()=>Y,deleteAudioOnClaim:()=>Q,initTopAudioPlayer:()=>X,AudioMessagePlayer:()=>J,mentionClick:()=>Z,isArticleLayerOpen:()=>ee,showDonutSubscribePopup:()=>te,sendCoronaStatusStat:()=>ne,sendImageStatusStat:()=>re});n(21466),n(83946),n(59357),n(20075),n(75115);var r=n(61540),o=n(49535),i=n(95724),a=n(54612),s=n(15544),c=n(26271),l=n(86409),u=n(86067),d=n(68040),_=n(86125),p=n(91789),h=n(79957),f=n(71516),m=n(82452),g=n(73271),v=n(49464),y=n(8928),E=n(21324);function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function b(){var e=["notifier.js","notifier.css"];return{preload:function(){stManager.add(e,(()=>window.TopNotifier.preload()))},show:function(t){if(!0!==(0,o.checkEvent)(t))return stManager.add(e,(()=>window.TopNotifier.show(t))),(0,o.cancelEvent)(t)},showTooltip:function(t){stManager.add(e,(()=>window.TopNotifier.showTooltip(t)))},invalidate:()=>{},setCount:()=>{},createNewEventsBox:()=>{}}}function C(){return!c.browser.msie||parseInt(c.browser.version)>10}function S(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(r&&r.additional&&r.additional.open_pe&&r.temp&&(0,p.isImgBlurred)(r.temp)){var s=function(){S(e,t,r,a)};Page.showUnblurBox(r.temp.restrictionTitle,r.temp.restrictionText,r.temp.photoRaw,r.temp.unblurHash,s)}else{if(r&&r.additional&&r.additional.open_pe&&r.temp&&r.temp.restrictionGeo&&delete r.additional.open_pe,cur.viewAsBox)return cur.viewAsBox();if(!((0,o.checkEvent)(a)||cur._editMode&&cur._editMode(a))){if((0,g.isUnauthorizedMediaLayerBoxAvailable)()&&!r.forceUnauth)return g.Unauthorized.showMoreBox(null,0,g.UnauthorizedSourceType.PHOTO,(()=>{S(e,t,w({},r,{forceUnauth:!0}),a)})),!1;var c=[jsc("web/photoview.js"),"photoview.css","page.js","page.css"];if(r.img&&(r.showProgress=function(){(0,l.showProgress)(r.img)},r.hideProgress=function(){(0,l.hideProgress)(r.img)}),!e)return!1;var u=1;if(((null==r||null===(n=r.additional)||void 0===n?void 0:n.open_pe)||(null==r?void 0:r.noCache))&&(u=0),window.Photoview&&!1===Photoview.showPhoto(e,t,r)&&u)return!1;var d=!0;if(cur.pvOptions||(cur.pvOptions={}),cur.pvOptions.isLightMode=r.isLightMode,r.temp&&!(cur.pvNoTemp||{})[e]&&stManager.add(c,(function(){(0,i.extend)(cur,{pvCancelLoad:function(){d=!1},pvData:cur.pvData||{},pvOptions:cur.pvOptions||{}}),cur.pvData.temp=[r.temp],cur.pvOptions.temp_final=r.temp_final,cur.pvOptions.temp_summary=r.temp_summary,cur.pvOptions.queue=r.queue,Photoview.show("temp",0)})),(0,i.extend)(r,{onDone:function(n){Photoview.list(e,t,n),r.blog_text&&arguments[3]&&arguments[3][0]&&(arguments[3][0].album=r.blog_text),Photoview.loaded.apply(window,arguments),d&&("deleted"===n?Photoview.showDeleted.apply(window,arguments):Photoview.showPhoto(e,t,r,!0))},stat:c,cache:u}),r.temp_final)return!1;var _="";return nav.objLoc.dmcah&&(_=nav.objLoc.dmcah),ajax.post("al_photos.php",(0,i.extend)({act:"show",gid:cur.gid,photo:e,list:t,dmcah:_,module:cur.module||"",list_info:r.list_info||null},r.additional),r),!1}}}function T(e,t,n,r){Page.showManyPhoto(e,t,n,r)}function D(e,t,n){return cur.viewAsBox?cur.viewAsBox():(0,o.checkEvent)(n)?void 0:(stManager.add([jsc("web/photoview.js"),"photoview.css"],(function(){Photoview.showAlbums(e,t)})),!1)}function P(e,t,n){return cur.viewAsBox?cur.viewAsBox():(0,o.checkEvent)(n)?void 0:(stManager.add([jsc("web/photoview.js"),"photoview.css"],(function(){Photoview.showAlbum(e,t)})),!1)}function A(e,t,n){return cur.viewAsBox?cur.viewAsBox():(0,o.checkEvent)(n)?void 0:(stManager.add([jsc("web/photoview.js"),"photoview.css"],(function(){Photoview.showTagged(e,t)})),!1)}function k(e,t,n){return cur.viewAsBox?cur.viewAsBox():(0,o.checkEvent)(n)?void 0:(stManager.add([jsc("web/video.js"),"video.css",jsc("web/photoview.js"),"photoview.css"],(function(){Photoview.showVideoTags(e,t)})),!1)}function I(e){var t=e.shift();if(window.Videoview&&Videoview.playerCallback[t])return Videoview.playerCallback[t].apply(Videoview,e);throw Error("Unregistered player callback: "+t)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return curBox()||(0,a.showBox)("al_market.php",{act:"show_attach_product_box"},{onDone:function(e,n){window.MarketProductBox.init(e,n,t)}}),(0,o.cancelEvent)(e)}function x(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,o.checkEvent)(n))return!0;if(0!==cur.gid&&(e.gid=cur.gid),e.location_owner_id=cur.oid,window.wkcur&&wkcur.shown&&wkcur.wkRaw===e.w&&e.w&&!e.reply)return WkView.restoreLayer(r),(0,o.cancelEvent)(n);(window.wkcur&&wkcur.hideTitle||e.hide_title)&&(r.hide_title=e.hide_title=1);var a=r.stat||[jsc("web/wkview.js"),"wkview.css","wk.css",jsc("web/wk.js")];t&&a.push(jsc("web/wk_editor.js"),"wk_editor.css");var s,c,l={stat:a,loader:!r.noloader,onDone:function(e,t,o,a){WkView.show(e,t,(0,i.extend)(o,r),a,n)},onFail:function(e){return(0,i.isFunction)(r.onFail)?r.onFail(e):WkView.showError(e)}};if(nav.objLoc.claim&&(e.claim=nav.objLoc.claim),nav.objLoc.tariff_act&&(e.tariff_act=nav.objLoc.tariff_act),e.w&&"/query"===e.w.substr(-6)){var u=(0,i.clone)(nav.objLoc);delete u[0],delete u.w,e.query=JSON.stringify(u)}r.preload&&(0,i.extend)(l,r.preload),r.ads_params&&(s=r.ads_params,(c=nav.getPostParams(n&&n.target)).post_click_url&&(s._post_click_url=c.post_click_url));var d="";"feed"===cur.module&&window.feed?d=window.feed.getModuleRef():"public"===cur.module?d="club":"profile"===cur.module&&(d="profile"),r.customRef&&(d=r.customRef);var _="",p=(0,i.clone)(nav.objLoc);return p.dmcah&&(_=p.dmcah),ajax.post("wkview.php",(0,i.extend)({act:"show",loc:nav.objLoc[0],is_znav:r.isZnav,dmcah:_,ref:d},e,s,cur.getWkviewOpts&&cur.getWkviewOpts()),l),(0,o.cancelEvent)(n)}function R(e,t,n,r,o,a){a||(a={});var s=!1,c=(0,i.extend)({w:"app"+t},a);if(n=(0,i.intval)(n),r&&((0,i.isObject)(r)?c=(0,i.extend)(c,r):c.ref=r),a.layer&&(s=!0),(cur.apps&&cur.apps[t]||!n)&&!s){delete c.w;var l="app"+t+(o?"_"+o:""),u=nav.objLoc&&!nav.objLoc[1]&&nav.objLoc[0]===l;return nav.go("/"+l+nav.toStr(c),e,{nocur:u})}o&&(c.mid=o);var d={stat:[jsc("web/wkview.js"),"wkview.css","apps.js","apps.css"]};a.queue&&(d.queue=1);var _=cur.module;if(d.onHide=()=>{cur.module=_,a.onHide&&a.onHide()},a.urlHash&&(c.url_hash=a.urlHash),c["#"]){var p=c["#"];delete c["#"],d.onLoaded=()=>{nav.setLoc((0,i.extend)(nav.objLoc,{"#":p}))}}return x(c,!1,e,d)}function M(e,t,n,r,i){if(!vk.widget)return(0,s.show)(boxLoader),(0,s.show)(boxLayerWrap),(0,_.boxRefreshCoords)(boxLoader),stManager.add([jsc("web/podcast.js")],(function(){Podcast.show(e,t,null,r,i)})),n&&(0,o.cancelEvent)(n)}function L(e,t,n,r){return stManager.add([jsc("web/podcast.js")],(function(){Podcast.goToTime(e,t,n,r)})),n&&(0,o.cancelEvent)(n)}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e&&!vk.isBanned&&stManager.add([jsc("web/article_layer.js"),"article.css"],(function(){window.ArticleLayer.prepare(e,n,t)}))}function B(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(cur.articleEditorLayer)cur.articleEditorLayer.openById(e,t);else{var i=[jsc("web/article_editor_layer.js"),"article.css","article_editor.css"];stManager.add(i,(()=>{}));var s=Object.assign({act:"open_editor",article_owner_id:e,article_id:t,from_post_convert:n?1:0,post_data_medias:n?n.medias.join(","):""},r);ajax.post("al_articles.php",s,{loader:!0,onFail:function(e){return"app"===o.from?o.errorHandler&&o.errorHandler("ServerError: Can't open article editor."):(0,a.showFastBox)((0,u.getLang)("global_error"),e),window.SAKIntegration&&window.SAKIntegration.isIntegrated&&window.SAKIntegration.sendMessage("error",{error:e}),!0},onDone:function(e,t,r,a){window.WkView&&WkView.hide(),window.boxQueue&&boxQueue.hideAll(),n&&(a.postData=n),a.articleOwnerId?stManager.add(i,(function(){if(layers.fullhide=function(){cur.articleEditorLayer&&cur.articleEditorLayer.hide()},window.AuthorPage&&window.AuthorPage.isOpen()&&(cur.needAuthorPageHardBack=!0),cur.articleEditorLayer=new ArticleEditorLayer(e,t,r,a,(()=>delete cur.articleEditorLayer)),"app"===o.from){var n=e=>t=>{t.type=e,"publish"!==e&&"close"!==e||cur.articleEditorLayer&&cur.articleEditorLayer.hide(),o.eventHandler&&o.eventHandler(t)};cur.articleVkAppEditor={onSaveDraft:n("draft"),onPublish:n("publish"),onClose:n("close")}}})):nav.change({z:!1})}})}}function U(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";ajax.post("al_bookmarks.php",{act:"bookmark",owner_id:e,object_id:t,type:n,state:o?1:0,hash:r,item_access_hash:c,ref:l||cur.module,track_code:d},{onDone:(n,r,o,c)=>{if(n&&!vk.widget){window.showDoneBox(n,{tooltipHandler:function(n){var l=(0,s.geByClass1)("bookmarks_tag_set",n);if(l&&!isEmpty(r)){var d=[];each(r,((e,t)=>{d.push(t)})),d.sort(((e,t)=>e.order-t.order));for(var _='<div class="bookmarks_tags_list">',p=0;p<d.length;p++){var h=d[p];_+=`<div class="bookmarks_tags_list_item" data-id="${h.id}">${h.name}</div>`}_+="</div>",(_=se(_)).addEventListener("click",(n=>{var r=domClosest("bookmarks_tags_list_item",n.target);if(r){var l=(0,s.domData)(r,"id"),d=toggleClass(r,"bookmarks_tags_list_item--selected");ajax.post("al_bookmarks.php",{act:"set_tag",item_type:o,item_oid:e,item_id:t,hash:c,tag_id:l,is_tagged:(0,i.intval)(!d),is_from_snackbar:!0},{onFail:e=>((0,a.showFastBox)((0,u.getLang)("global_error"),e),!0)})}})),cur.setBookmarksTagTooltip&&cur.setBookmarksTagTooltip.destroy(),stManager.add(["ui_common.css","ui_common.js"],(()=>{}));var f=new ElementTooltip(l,{content:_,appendToParent:!0,cls:"bookmarks_tag_set_tt",autoShow:!0,offset:[0,-36],onFirstTimeShow:e=>{stManager.add(["ui_common.css","ui_common.js"],(()=>{cur.setBookmarksTagTooltipScrolls||(cur.setBookmarksTagTooltipScrolls=[]),cur.setBookmarksTagTooltipScrolls.push(new uiScroll(domFC(e),{theme:"dark"}))}))},onShow:function(){Notifier.freezeEvents(),curNotifier.tooltipShown=!0},onHide:function(){curNotifier.tooltipShown=!1,curNotifier.unfreezeAfterTooltipHide&&Notifier.unfreezeEvents()}});cur.destroy.push((()=>{cur.setBookmarksTagTooltipScrolls&&(cur.setBookmarksTagTooltipScrolls.forEach((function(e){e.destroy()})),delete cur.setBookmarksTagTooltipScrolls),f.destroy()}))}},link:"/bookmarks"})}}})}function F(e,t,n,r,o,a){var c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";if((0,i.isObject)(window.cur)&&(0,i.isFunction)(window.cur.viewAsBox))return window.cur.viewAsBox();var l=parseInt((0,s.domData)(e,"state"));e.innerHTML=l?(0,s.domData)(e,"add"):(0,s.domData)(e,"remove"),(0,s.domData)(e,"state",l?0:1),U(t,n,r,o,l,a,c)}function W(e,t,n,r,i,a,c){return t&&(c=parseInt((0,s.domData)(t,"state")),(0,s.domData)(t,"state",c?0:1)),U(n,r,i,a,c),each(geByClass(`_article_${n}_${r}`),((e,t)=>{var n=(0,s.geByClass1)("_bookmark_btn",t);(0,s.domData)(n,"state",c?0:1)})),(0,o.cancelEvent)(e)}function j(e,t,n){var r=parseInt((0,s.domData)(t,"state"));return(0,s.domData)(t,"state",r?0:1),ajax.post("al_bookmarks.php",{act:"bookmark_link",state:r?1:0,hash:n,url:(0,s.domData)(t,"link-url"),img:(0,s.domData)(t,"link-img"),title:(0,s.domData)(t,"link-title"),ref:cur.module,track_code:(0,s.domData)(t,"track-code")},{onDone:e=>{e&&!vk.widget&&window.showDoneBox(e)}}),(0,o.cancelEvent)(e)}function V(e,t,n,r,i){return stManager.add([jsc("web/podcast.js")],(function(){Podcast.toggleFave(e,t,n,i)})),r&&(0,o.cancelEvent)(r)}function H(e){return parseInt((0,s.domData)(e,"state"))}function K(e,t){(0,s.domData)(e,"state",t?0:1),e.innerHTML=t?(0,y.getIcon24FavoriteOutline)().icon:(0,E.getIcon24Favorite)().icon}function G(e,t,n,r,i,a){var s=H(t);return K(t,s),U(n,r,i,a,s),s||(0,v.sendNarrativeAnalytic)(v.NarrativeAnalyticEventType.addToBookmarks,{ownerId:n,id:r},window.cur.module),(0,o.cancelEvent)(e)}function z(e,t,n,r){var i=parseInt((0,s.domData)(t,"state"));return(0,s.domData)(t,"state",i?0:1),ajax.post("fave.php",{act:i?"a_delete_group":"a_add_group",gid:n,hash:r},{onDone:(e,t)=>{i||vk.widget||showDoneBox(t)}}),(0,o.cancelEvent)(e)}function q(e,t,n,r,i,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",l=H(t);return K(t,l),U(n,r,i,a,l,s,"",c),(0,o.cancelEvent)(e)}function $(e,t,n,r){return(0,a.showBox)("like.php",{act:"publish_box",object:"audio_playlist"+t+"_"+n,list:r},{stat:["wide_dd.js","wide_dd.css",jsc("web/sharebox.js")]}),(0,o.cancelEvent)(e)}function Y(){return window.ap=window.ap||new AudioPlayer,window.ap}function Q(e,t){var n=e+"_"+t,r=(0,s.geByClass1)("_audio_row_"+n);AudioUtils.deleteAudio(r,AudioUtils.getAudioFromEl(r,!0)),cur.claimWarning&&cur.claimWarning.hide()}function X(){window.TopAudioPlayer.init()}var J={loaded:!1,events:{on(e,t){stManager.add("voice_message_player.js",(()=>{window.AudioMessagePlayer.events.on(e,t)}))}},togglePlay:function(e){stManager.add("voice_message_player.js",(()=>{window.AudioMessagePlayer.togglePlay(e)}))},toggleTranscript:function(e){stManager.add("voice_message_player.js",(()=>{window.AudioMessagePlayer.toggleTranscript(e)}))},detachPlayer:function(e){stManager.add("voice_message_player.js",(()=>{window.AudioMessagePlayer.detachPlayer(e)}))}};function Z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e&&e.tt&&e.tt.hide&&e.tt.hide({fasthide:1});var o=e,a=!1;if(ee()&&ArticleLayer.isStandalone()&&(a=!0),o.tagName&&"a"===o.tagName.toLowerCase()&&!o.getAttribute("target")&&!nav.baseBlank){var s,c=o.getAttribute("hrefparams");c&&(n.params=(0,i.extend)(n.params||{},(0,d.fromQueryString)(c))),(o=(o=o.href||"").replace(/^https?:\/\//i,"")).indexOf(location.hostname)||(o=o.replace(location.hostname,"")),((o=o.replace(new RegExp(`^${r.VK_HOST_REGEX_UNSAFE.source}/`),"/")).match(/#$/)||!(s=o.match(/^\/(.*?)(\?|#|$)/))||(s=s[1]).indexOf(".php")>0||s.match(/^(doc\-?\d+_\d+|graffiti\d+|reg\d+|images|utils|\.js|js\/|\.css|css\/)/))&&(a=!0)}if(a){var l=!!(n&&n.params&&n.params._post&&n.params._post_click_type);if(!l)return!0;e.setAttribute("data-change-location-with-post-away",1),o=e}return nav.go(o,t,n)}function ee(){return window.ArticleLayer&&window.ArticleLayer.isShown()}function te(e,t,n,r,s){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";if(n||l){var u=`donut_payment${n}`,d=r,_=(0,a.showBox)("al_donut.php",w({act:"subscribe_popup",ownerId:n,ownerDomain:l,source:r,hash:s,type:c.type},c.params),{stat:["donut_subscribe_popup.css",window.jsc("web/donut_subscribe_popup.js")],params:{width:450,hideButtons:!0,containerClass:"DonutSubscribePopup",onDestroy:()=>{if(window.DonutSubscribePopup&&window.DonutSubscribePopup.onDestroy(),!c.fromSnippet){(0,o.removeEvent)(window,"popstate",p);var e=nav.objLoc,t=e.w,n=e.source;t===u&&d===n&&(delete nav.objLoc.w,delete nav.objLoc.source,nav.setLoc(nav.objLoc))}}},onDone:(e,t)=>{if(window.DonutSubscribePopup.init({ownerId:n||t.owner_id,source:r,type:c.type,onSuccessPayment:c.onSuccessPayment},e,t),!c.fromSnippet&&"subscribe"===c.type){(0,o.addEvent)(window,"popstate",p);var a=(0,i.extend)(nav.objLoc,{w:u,source:r});nav.setLoc(a)}},onFail:e=>{if(e&&"string"==typeof e)return"group_doesnt_exists"===e&&c.onFailCallback&&"function"==typeof c.onFailCallback?(c.onFailCallback(),_.hide(),!0):(_.hide(),(0,m.showErrorBox)(e),!0)}},t);(0,o.cancelEvent)(t)}function p(){_.hide()}}function ne(){(0,h.statlogsValueEvent)("corona_status_stat","open_app")}function re(e){e&&(0,f.saveStatlogEvents)({name:"image_status",value:e,keys:["popup_action"]})}},35676:(e,t,n)=>{"use strict";n.d(t,{Fx:()=>a,animate:()=>s,cubicBezier:()=>c,fadeTo:()=>l,genFx:()=>d,slideDown:()=>_,slideUp:()=>p,slideToggle:()=>h,fadeIn:()=>f,fadeOut:()=>m,fadeToggle:()=>g,getRGB:()=>v,getColor:()=>y,animateCount:()=>E});n(59357),n(66108),n(96253),n(21466);var r=n(95724),o=n(15544),i=n(26271),a={Transitions:{linear:(e,t,n,r)=>n*e/r+t,sineInOut:(e,t,n,r)=>-n/2*(Math.cos(Math.PI*e/r)-1)+t,halfSine:(e,t,n,r)=>n*Math.sin(Math.PI*(e/r)/2)+t,easeOutBack:function(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},easeInCirc:(e,t,n,r)=>-n*(Math.sqrt(1-(e/=r)*e)-1)+t,easeOutCirc:(e,t,n,r)=>n*Math.sqrt(1-(e=e/r-1)*e)+t,easeInQuint:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,easeOutQuint:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,easeOutCubic:(e,t,n,r)=>n*((e=e/r-1)*e*e+1)+t,swiftOut:(e,t,n,r)=>n*c(.4,0,.22,1,e/r,4/r)+t},Attrs:[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity","left","top"]],Timers:[],TimerId:null};function s(e,t,n,a){if(e=(0,o.ge)(e)){var s,c=(0,r.isFunction)(a)?a:()=>{},l=(0,r.extend)({},"object"==typeof n?n:{duration:n,onComplete:c}),d={},_={},p=(0,o.isVisible)(e);l.orig={},(t=(0,r.clone)(t)).discrete&&(l.discrete=1,delete t.discrete),i.browser.iphone&&(l.duration=0);var h=(0,o.data)(e,"tween"),f=p?"hide":"show";for(var m in h&&h.isTweening&&(l.orig=(0,r.extend)(l.orig,h.options.orig),h.stop(!1),h.options.show?f="hide":h.options.hide&&(f="show")),t)if(t.hasOwnProperty(m)){if(!h&&("show"===t[m]&&p||"hide"===t[m]&&!p))return l.onComplete.call(this,e);if("height"!==m&&"width"!==m||!e.style||(t.overflow||(void 0===l.orig.overflow&&(l.orig.overflow=(0,o.getStyle)(e,"overflow")),e.style.overflow="hidden"),(0,o.hasClass)(e,"inl_bl")||"TD"===e.tagName||(e.style.display="block")),/show|hide|toggle/.test(t[m]))if("toggle"===t[m]&&(t[m]=f),"show"===t[m]){s=0,l.show=!0,void 0===l.orig[m]&&(l.orig[m]=(0,o.getStyle)(e,m,!1)||"",(0,o.setStyle)(e,m,0));var g=e.style[m];e.style[m]=l.orig[m],t[m]=parseFloat((0,o.getStyle)(e,m,!0)),e.style[m]=g,"height"===m&&i.browser.msie&&!t.overflow&&(e.style.overflow="hidden")}else void 0===l.orig[m]&&(l.orig[m]=(0,o.getStyle)(e,m,!1)||""),l.hide=!0,t[m]=0}return l.show&&!p&&(0,o.show)(e),h=new u(e,l),(0,r.each)(t,(function(t,n){if(/backgroundColor|borderBottomColor|borderLeftColor|borderRightColor|borderTopColor|color|borderColor|outlineColor/.test(t)){if(s=y(e,"borderColor"===t?"borderTopColor":t),n=v(n),void 0===s)return}else{var i=n.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/);i&&(n=parseFloat(i[2]),i[1]&&(n=("-="==i[1]?-1:1)*n+n)),0!=(s=h.cur(t,!0))||"width"!==t&&"height"!==t||(s=1),"opacity"===t&&n>0&&!p&&((0,o.setStyle)(e,"opacity",0),s=0,(0,o.show)(e))}(s!=n||(0,r.isArray)(s)&&s.join(",")===n.join(","))&&(d[t]=s,_[t]=n)})),h.start(d,_),(0,o.data)(e,"tween",h),h}}function c(e,t,n,r,o,i){var a,s,c=function(t){var r=1-t;return 3*r*r*t*e+3*r*t*t*n+t*t*t},l=function(e){var n=1-e;return 3*n*n*e*t+3*n*e*e*r+e*e*e},u=function(t){var r=1-t;return 3*(2*(t-1)*t+r*r)*e+3*(-t*t*t+2*r*t)*n},d=o;for(a=d,s=0;s<8;s++){var _=c(a)-d;if(Math.abs(_)<i)return l(a);var p=u(a);if(Math.abs(p)<1e-6)break;a-=_/p}var h=0,f=1;if((a=d)<h)return l(h);if(a>f)return l(f);for(;h<f;){var m=c(a);if(Math.abs(m-d)<i)return l(a);d>m?h=a:f=a,a=.5*(f-h)+h}return l(a)}function l(e,t,n,r){return s(e,{opacity:n},t,r)}class u{constructor(e,t,n){this.el=(0,o.ge)(e),this.name=n,this.options=(0,r.extend)({onStep:()=>{},onComplete:()=>{},transition:t.transition||a.Transitions.sineInOut,duration:500},t||{})}start(e,t){this.from=e,this.to=t,this.time=(0,r.vkNow)(),this.isTweening=!0;var n=e=>this.step(e);return n.el=this.el,n()&&a.Timers.push(n)&&!a.TimerId&&(a.TimerId=setInterval((function(){for(var e=a.Timers,t=e.length,n=0;n<t;n++)e[n]()||(e.splice(n--,1),t--);t||(clearInterval(a.TimerId),a.TimerId=null)}),13)),this}stop(e){for(var t=a.Timers,n=t.length-1;n>=0;n--)t[n].el===this.el&&(e&&t[n](!0),t.splice(n,1));this.isTweening=!1}step(e){var t=(0,r.vkNow)();if(!e&&t<this.time+this.options.duration){for(var n in this.cTime=t-this.time,this.now={},this.to)if((0,r.isArray)(this.to[n])){for(var i=[],a=0;a<3;a++){if(void 0===this.from[n]||void 0===this.to[n])return!1;i.push(Math.min(parseInt(this.compute(this.from[n][a],this.to[n][a])),255))}this.now[n]=i}else this.now[n]=this.compute(this.from[n],this.to[n]),this.options.discrete&&(this.now[n]=(0,r.intval)(this.now[n]));return this.update(),!0}return setTimeout(this.options.onComplete.bind(this,this.el),10),this.now=(0,r.extend)(this.to,this.options.orig),this.update(),this.options.hide&&(0,o.hide)(this.el),this.isTweening=!1,!1}compute(e,t){var n=t-e;return this.options.transition(this.cTime,e,n,this.options.duration)}update(){for(var e in this.options.onStep(this.now),this.now)(0,r.isArray)(this.now[e])?(0,o.setStyle)(this.el,e,"rgb("+this.now[e].join(",")+")"):void 0!==this.el[e]?this.el[e]=this.now[e]:(0,o.setStyle)(this.el,e,this.now[e])}cur(e,t){return null==this.el[e]||this.el.style&&null!=this.el.style[e]?parseFloat((0,o.getStyle)(this.el,e,t))||0:this.el[e]}}function d(e,t){var n={};return(0,r.each)(a.Attrs.concat.apply([],a.Attrs.slice(0,t)),(function(){n[this]=e})),n}a.Base=u;var _=(e,t,n)=>s(e,d("show",1),t,n),p=(e,t,n)=>s(e,d("hide",1),t,n),h=(e,t,n)=>s(e,d("toggle",1),t,n),f=(e,t,n)=>s(e,{opacity:"show"},t,n),m=(e,t,n)=>s(e,{opacity:"hide"},t,n),g=(e,t,n)=>s(e,{opacity:"toggle"},t,n);function v(e){var t;return e&&(0,r.isArray)(e)&&3==e.length?e:(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))?[2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3])]:(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:void 0}function y(e,t){var n;do{if(0===(n=(0,o.getStyle)(e,t)).indexOf("rgba")&&(n=""),""!=n&&"transparent"!==n||"body"===e.nodeName.toLowerCase())break;t="backgroundColor",e=e.parentNode}while(e);return v(n)}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=(0,o.ge)(e),t=n.str?(0,r.trim)(t.toString())||"":(0,r.positive)(t),e)if(!i.browser.mobile||i.browser.safari_mobile||i.browser.android){var c=(0,o.data)(e,"curCount"),l=(0,o.data)(e,"nextCount");if("number"==typeof l||n.str&&"string"==typeof l)t!=l&&(0,o.data)(e,"nextCount",t);else if("number"==typeof c||n.str&&"string"==typeof c)t!==c&&(0,o.data)(e,"nextCount",t);else if(c=n.str?(0,r.trim)((0,o.val)(e).toString())||"":(0,r.positive)((0,o.val)(e)),"auto"===n.str&&(n.str=!c.match(/^\d+$/)||!t.match(/^\d+$/),n.str||(c=(0,r.positive)(c),t=(0,r.positive)(t))),c!==t){(0,o.data)(e,"curCount",t);var u,d,_=n.str?c.length===t.length?c<t:c.length<t.length:c<t,p=(_?t:c).toString(),h=(_?c:t).toString(),f=[],m=[];for(n.str||(h=new Array(p.length-h.length+1).join("0")+h),u=0,d=p.length;u<d;u++){var g=p.charAt(u);if(g!==h.charAt(u))break;f.push(g)}var v=p.substr(u),y=h.substr(u);if(n.str){for(u=v.length;u>0;u--){var w=v.charAt(u);if(w!==y.charAt(u))break;m.unshift(w)}m.length&&(v=v.substr(0,u+1),y=y.substr(0,u+1))}f=f.join("").replace(/\s$/,"&nbsp;"),m=m.join("").replace(/^\s/,"&nbsp;"),(0,r.trim)((0,o.val)(e))||n.noSpaceIfEmpty||(0,o.val)(e,"&nbsp;");var b=e.clientHeight||e.offsetHeight;(0,o.val)(e,'<div class="counter_wrap inl_bl"></div>');var C,S,T,D,P=e.firstChild,A=!0;f.length&&P.appendChild(C=(0,o.ce)("div",{className:"counter_const inl_bl",innerHTML:f})),f.length||n.allowZero||(y=y.replace(/^0+/,"")),y&&("0"!==y||n.allowZero||f.length)||(y=n.noSpaceIfEmpty?"":"&nbsp;",A=!!f.length),P.appendChild(T=(0,o.ce)("div",{className:"counter_anim_wrap inl_bl"})),T.appendChild(D=(0,o.ce)("div",{className:"counter_anim "+(_?"counter_anim_inc":"counter_anim_dec"),innerHTML:`<div class="counter_anim_big"><span class="counter_anim_big_c">${v}</span></div>`+(A?`<div class="counter_anim_small"><span class="counter_anim_small_c">${y}</span></div>`:"")},A?{marginTop:_?-b:0}:{right:0})),n.str&&(0,o.setStyle)(D,{textAlign:"right",right:0});var k=(0,o.getSize)((0,o.geByClass1)("counter_anim_big_c",D,"span"))[0],I=A?"&nbsp;"===y?k:(0,o.getSize)((0,o.geByClass1)("counter_anim_small_c",D,"span"))[0]:0;!y&&n.noSpaceIfEmpty&&(I=0),m.length&&P.appendChild(S=(0,o.ce)("div",{className:"counter_const inl_bl",innerHTML:m})),n.noWrapWidth||(0,o.setStyle)(P,{width:(C&&(0,o.getSize)(C)[0]||0)+(S&&(0,o.getSize)(S)[0]||0)+k+0}),void 0===i.browser.csstransitions&&(i.browser.csstransitions=i.browser.chrome&&i.browser.version>=9||i.browser.mozilla&&i.browser.version>=4||i.browser.opera&&i.browser.version>=10.5||i.browser.safari&&i.browser.version>=3.2||i.browser.safari_mobile||i.browser.android);var O=i.browser.csstransitions;(0,o.setStyle)(T,{width:_?I:k});var x=function(){(0,o.val)(e,t||(n.noSpaceIfEmpty?"":" "));var r=(0,o.data)(e,"nextCount");(0,o.data)(e,"curCount",!1),(0,o.data)(e,"nextCount",!1),("number"==typeof r||n.str&&"string"==typeof r)&&setTimeout(E.pbind(e,r,n),0),n.onDone&&n.onDone()},R=A?{marginTop:_?0:-b}:{marginRight:_?-I:0};O?((0,o.getStyle)(T,"width"),(0,o.addClass)(T,"counter_css_anim_wrap"),k!==I&&(0,o.setStyle)(T,{width:_?k:I}),A&&(0,o.setStyle)(D,R),setTimeout(x,300),n.fadeMode&&((0,o.setStyle)((0,o.geByClass1)("counter_anim_big",e),"opacity",1),(0,o.setStyle)((0,o.geByClass1)("counter_anim_small",e),"opacity",0))):(k!==I&&s(T,{width:_?k:I},{duration:100}),A?s(D,R,{duration:300,transition:a.Transitions.easeOutCirc,onComplete:x}):setTimeout(x,300))}}else(0,o.val)(e,t||"")}},68958:(e,t,n)=>{"use strict";n.d(t,{isWeirdLogging:()=>a,imWeirdCatch:()=>c});n(40851),n(96253);var r=n(87294),o=n(91040),i=1;function a(){return!!window.imwl}function s(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];a()&&(n&&window.console&&(console.error(e,t),console.trace&&console.trace()),(0,o.retryFn)(r.post,3,(()=>2))("al_im.php",{act:"a_weird_log",kind:e,data:JSON.stringify(extend({errIdx:i++,ua:navigator.userAgent},t))}))}function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(e,extend({err:t&&t.message||t},n)),Promise.reject(t)}},416:(e,t,n)=>{"use strict";n.d(t,{placeholderSetup:()=>u,placeholderInit:()=>d});n(21466);var r=n(15544),o=n(49535),i=n(35676),a=n(95724),s=n(26271),c=n(19331);function l(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,c=e.phshown,l=e.phcont,u=n.back,d=n.editable,_=n.hideBackAfter,p=n.timeout,h=n.phColor,f=void 0===h?"#8C8E91":h,m=n.activeColor,g=void 0===m?"#C0C8D0":m,v=p||0===p?p:100,y=n.period||200;if(t=d?(void 0!==e.textContent?e.textContent:e.innerText)||(0,r.geByTag)("img",e).length:e.value,c&&(u&&t||!u&&(o&&!o.type||t))?((0,r.hide)(l),e.phshown=!1):c||t||!u&&!a||((0,r.show)(l),e.phshown=!0,s.browser.opera&&a&&(e.setAttribute("placeholder",""),e.removeAttribute("placeholder",""))),u&&!t){if(o&&!o.type){var E=_?r.hide.pbind(l.firstChild.firstChild):null;clearTimeout(e.phanim),e.phanim=setTimeout((function(){(0,i.animate)(l.firstChild.firstChild,{color:g},y,E)}),v)}a&&(clearTimeout(e.phanim),_&&(0,r.show)(l.firstChild.firstChild),e.phanim=setTimeout((function(){(0,i.animate)(l.firstChild.firstChild,{color:f},y)}),v))}}function u(e,t){var n=(0,r.ge)(e);if(!n)return!1;if(!(n.getAttribute?n.getAttribute("contenteditable"):n.contenteditable)&&(0,c.partConfigEnabled)("native_placeholder_enable"))return!1;var i=t?(0,a.clone)(t):{};if(!n.phevents||i.reload){var u=n.getAttribute?n.getAttribute("placeholder"):n.placeholder;if(u){n.removeAttribute("placeholder");var d={},_=!1,p=["Top","Bottom","Left","Right"];if(i.pad)d=i.pad;else{if(i.fast){for(var h=0;h<4;h++)d["padding"+p[h]]=3,d["margin"+p[h]]=0,d["border"+p[h]+"Width"]=1;(0,a.extend)(d,i.styles||{})}else{for(var f=[],m=0;m<4;m++)f.push("margin"+p[m]),f.push("padding"+p[m]),f.push("border"+p[m]+"Width");d=(0,r.getStyle)(n,f)}for(var g=0;g<4;g++){var v="margin"+p[g],y="border"+p[g]+"Width";d[v]=(0,a.intval)(d[v])+(0,a.intval)(d[y])+"px",delete d[y]}}if(i.reload){var E=n.previousSibling;E&&(0,r.hasClass)(E,"input_back_wrap")&&(0,r.re)(E)}var w=i.big?" big":"",b=(0,r.getSize)(n)[0]-20,C=n.phcont=n.parentNode.insertBefore((0,r.ce)("div",{className:"input_back_wrap no_select",innerHTML:`<div class="input_back"><div class="input_back_content${w}" style="width: ${b}px;">${u}</div></div>`}),n),S=(0,r.domFC)(C);(0,r.setStyle)(S,d);var T=l.pbind(n,i),D=s.browser.mobile?T:(e,t)=>setTimeout(T.pbind(e,t),0);s.browser.msie&&s.browser.version<8&&(0,r.setStyle)(S,{marginTop:1}),n.phonfocus=function(e){_||(n.focused=!0,cur.__focused=n,!0===e&&((0,r.setStyle)(n,{backgroundColor:"#FFF"}),(0,r.hide)(S)),D(!0,!1))},n.phonblur=function(){_||(cur.__focused=n.focused=!1,(0,r.show)(S),D(!1,!0))},n.phshown=!0,n.phanim=null,(n.value||i.editable&&((void 0!==n.textContent?n.textContent:n.innerText)||(0,r.geByTag)("img",n).length))&&(n.phshown=!1,(0,r.hide)(C)),s.browser.opera_mobile||((0,o.addEvent)(C,"focus click",(function(e){_||(i.editableFocus?(setTimeout(i.editableFocus.pbind(n),0),n.phonfocus()):(n.blur(),n.focus()))})),(0,o.addEvent)(n,"focus"+(i.editable?" click":""),n.phonfocus),(0,o.addEvent)(n,"keydown paste cut input",D)),(0,o.addEvent)(n,"blur",n.phonblur),n.check=D,n.getValue=()=>i.editable?n.innerHTML:n.value,n.setPlaceholder=e=>(0,r.geByClass1)("input_back_content",C).textContent=e,n.setDisabled=e=>_=e,n.setValue=function(e){i.editable?n.innerHTML=e:n.value=e,l(n,i)},n.phevents=!0,n.phonsize=function(){},i.global||i.reload||(cur.__phinputs||(cur.__phinputs=[],cur.destroy.push(function(e){for(var t=0,n=e.length;t<n;t++)(0,r.removeData)(e[t])}.pbind(cur.__phinputs))),cur.__phinputs.push(n))}}}function d(e,t){var n=(0,r.ge)(e);if(!n)return!1;if(!(n.getAttribute?n.getAttribute("contenteditable"):n.contenteditable)&&(0,c.partConfigEnabled)("native_placeholder_enable"))return!1;var i=t?(0,a.clone)(t):{},l=void 0===(0,r.ce)("input").placeholder||n&&n.getAttribute&&n.getAttribute("contenteditable");if(!n.phevents||i.reload){var u=n.getAttribute?n.getAttribute("placeholder"):n.placeholder;if(u&&(n.getValue=function(){return i.editable?n.innerHTML:n.value},n.setValue=function(e){i.editable?n.innerHTML=e:n.value=e,l&&f(n,i)},n.phonfocus=function(){},n.phonblur=function(){},l)){if(n.removeAttribute("placeholder"),i.reload){var d=(0,r.domNS)(n);d&&(0,r.hasClass)(d,"placeholder")&&(0,r.re)(d)}var _=n.phcont=(0,r.domInsertAfter)((0,r.ce)("div",{className:"placeholder",innerHTML:'<div class="ph_input"><div class="ph_content">'+u+"</div></div>"}),n),p=f.pbind(n,i),h=s.browser.mobile?p:(e,t)=>setTimeout(p.pbind(e,t),0);n.phonfocus=function(){n.focused=!0,cur.__focused=n,h(!0,!1)},n.phonblur=function(){cur.__focused=n.focused=!1,h(!1,!0)},n.phshown=!0,(n.value||i.editable&&((void 0!==n.textContent?n.textContent:n.innerText)||(0,r.geByTag)("img",n).length))&&(n.phshown=!1,(0,r.hide)(_)),s.browser.opera_mobile||((0,o.addEvent)(_,"focus click contextmenu",(function(e){i.editableFocus?(setTimeout(i.editableFocus.pbind(n),0),"contextmenu"===e.type&&s.browser.msie&&i.editableFocus(n),n.phonfocus()):(n.blur(),n.focus())})),(0,o.addEvent)(n,"focus"+(i.editable?" click":""),n.phonfocus),(0,o.addEvent)(n,"keydown paste cut input",h)),(0,o.addEvent)(n,"blur",n.phonblur),n.check=h,n.phevents=!0,n.phonsize=function(){},i.global||i.reload||(cur.__phinputs||(cur.__phinputs=[],cur.destroy.push((function(){if(cur.__phinputs)for(var e=0,t=cur.__phinputs.length;e<t;++e)(0,r.removeData)(cur.__phinputs[e])}))),cur.__phinputs.push(n))}}function f(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.phshown,i=e.phcont,a=n.editable;a?((t=void 0!==e.textContent?e.textContent:e.innerText)&&s.browser.opera&&t.match(/^[ ]+$/)&&(t=""),t||(t=(0,r.geByTag)("img",e).length>0),t||(t=(0,r.geByTag)("br",e).length>1),t||(t=(0,r.geByTag)("p",e).length>1)):t=e.value,o&&t?((0,r.hide)(i),e.phshown=!1):o||t||((0,r.show)(i),e.phshown=!0)}}},86067:(e,t,n)=>{"use strict";n.d(t,{parseLatin:()=>s,parseCyr:()=>c,parseLatKeys:()=>l,langNumeric:()=>u,langSex:()=>d,langStr:()=>_,addLangKeys:()=>p,getLang:()=>h,langDate:()=>f,getShortDate:()=>m,getShortDateWithTime:()=>g,getShortDateOrTime:()=>v,langWordNumeric:()=>y,getDateText:()=>E,getBigDateNew:()=>w,getSmDate:()=>b});n(30522),n(59357),n(66108),n(96253),n(51876);var r=n(40906),o=n(89988),i=n(95724),a=n(87481);function s(e){for(var t=["yo","zh","kh","ts","ch","sch","shch","sh","eh","yu","ya","YO","ZH","KH","TS","CH","SCH","SHCH","SH","EH","YU","YA","'"],n=["ё","ж","х","ц","ч","щ","щ","ш","э","ю","я","Ё","Ж","Х","Ц","Ч","Щ","Щ","Ш","Э","Ю","Я","ь"],r=e,o=0,i=t.length;o<i;o++)r=r.split(t[o]).join(n[o]);for(var a="abvgdezijklmnoprstufhcyABVGDEZIJKLMNOPRSTUFHCYёЁ",s=0,c=a.length;s<c;s++)r=r.split(a.charAt(s)).join("абвгдезийклмнопрстуфхцыАБВГДЕЗИЙКЛМНОПРСТУФХЦЫеЕ".charAt(s));return r===e?null:r}function c(e){for(var t=["yo","zh","kh","ts","ch","sch","shch","sh","eh","yu","ya","YO","ZH","KH","TS","CH","SCH","SHCH","SH","EH","YU","YA","'"],n=["ё","ж","х","ц","ч","щ","щ","ш","э","ю","я","Ё","Ж","Х","Ц","Ч","Щ","Щ","Ш","Э","Ю","Я","ь"],r="абвгдезийклмнопрстуфхцыАБВГДЕЗИЙКЛМНОПРСТУФХЦЫеЕ",o=e,i=0;i<n.length;i++)o=o.split(n[i]).join(t[i]);for(var a=0;a<r.length;a++)o=o.split(r.charAt(a)).join("abvgdezijklmnoprstufhcyABVGDEZIJKLMNOPRSTUFHCYёЁ".charAt(a));return o===e?null:o}function l(e){for(var t="qwertyuiop[]asdfghjkl;'zxcvbnm,./`",n=e,r=0;r<t.length;r++)n=n.split(t.charAt(r)).join("йцукенгшщзхъфывапролджэячсмитьбю.ё".charAt(r));return n==e?null:n}function u(e,t,n){if(!t||!window.langConfig){if(!(0,r.isNumeric)(e)){var o=new Error("Non-numeric value passed to langNumeric");throw console.log(e,o),o}return String(e)}var a;if((0,i.isArray)(t)?(a=t[1],e!=Math.floor(e)?a=t[langConfig.numRules.float]:(0,i.each)(langConfig.numRules.int,(function(n,r){if("*"==r[0])return a=t[r[2]],!1;var o=r[0]?e%r[0]:e;return-1!=(0,i.indexOf)(r[1],o)?(a=t[r[2]],!1):void 0}))):a=t,n){for(var s=e.toString().split("."),c=[],l=s[0].length-3;l>-3;l-=3)c.unshift(s[0].slice(l>0?l:0,l+3));s[0]=c.join(langConfig.numDel),e=s.join(langConfig.numDec)}return a=(a||"%s").replace("%s",e)}function d(e,t){if(!(0,i.isArray)(t))return t;var n=t[1];return window.langConfig?((0,i.each)(langConfig.sexRules,(function(r,o){return"*"==o[0]||e==o[0]&&t[o[1]]?(n=t[o[1]],!1):void 0})),n):n}function _(e){for(var t=arguments,n=t.length,r=e+"",o=1;o<n;o+=2){var i="%"===t[o][0]?t[o]:"{"+t[o]+"}";r=r.replace(i,t[o+1])}return r}function p(e,t){var n=t?window:window.cur;n.lang?(0,i.extend)(n.lang,e):n.lang=e}function h(){try{var e=Array.from(arguments),t=e.shift();if(!t)return"...";var n=window.cur&&window.cur.lang&&window.cur.lang[t]||window.lang&&window.lang[t]||window.langpack&&window.langpack[t]||window[t];if(!n){var r=t.split("_");return r.shift(),r.join(" ")}return(0,i.isFunction)(n)?n.apply(null,e):void 0===e[0]&&!(0,i.isArray)(n)||"raw"===e[0]?n:u(e[0],n,e[1])}catch(e){(0,a.debugLog)("lang error:"+e.message+"("+Array.from(arguments).join(", ")+")")}}function f(e,t,n,r,a,s){var c;if(s||(s=""),(0,i.isArray)(t)||(t=["",t,t,t,t]),"number"==typeof e||"string"==typeof e?(e>2147483646e3&&(e=0),e+=n,c=new Date(e)):c=e,a)t=t[1];else{var l="";!(l=(0,o.isToday)(c)?t[3]:(0,o.isYesterday)(c)?t[2]:(0,o.isTomorrow)(c)?t[4]:t[1])&&t[1]&&(l=t[1]),t=l}var u={hours:c.getHours(),minutes:c.getMinutes(),seconds:c.getSeconds(),day:c.getDate(),month:c.getMonth()+1,year:c.getFullYear()},d="";switch(3===vk.lang&&(d=c.getHours()>11?"pm":"am",u.hours=c.getHours()%12==0?12:c.getHours()%12),vk.lang){case 1:switch(c.getHours()){case 11:t=t.replace(" о "," об ");break;case 0:t=t.replace(" о "," в ")}break;case 3:!(0,o.isToday)(c)||(0,o.isYesterday)(c)||(0,o.isTomorrow)(c)||(t=s+t);break;case 12:case 73:1==c.getHours()&&(t=t.replace(" &#224;s "," &#224; "))}return 68===vk.lang&&(u.year=u.year+543),t.replace("{hour}",u.hours).replace("{num_hour}",(0,o.leadingZero)(u.hours)).replace("{minute}",(0,o.leadingZero)(u.minutes)).replace("{day}",u.day).replace("{num_day}",(0,o.leadingZero)(u.day)).replace("{month}",r[u.month]).replace("{year}",u.year).replace("{short_year}",u.year%100).replace("{second}",(0,o.leadingZero)(u.seconds)).replace("{am_pm}",d)}function m(e,t,n,r,o){e*=1e3,void 0===n&&(n=!0),void 0===r&&(r=h("months_of","raw")),t*=1e3;var i=Date.now(),a=new Date(i),s=new Date(e+t);return!o&&e>i&&e-i<864e5&&a.getDate()===s.getDate()?f(e,"{hour}:{minute} {am_pm}",t,[],!n):s.getYear()!==a.getYear()||e<i-157248e5?f(e,h("global_date","raw"),t,r,!n):f(e,h("global_short_date","raw"),t,r,!n)}function g(e,t,n,r){return(0,o.isToday)(new Date(1e3*e+1e3*t))?f(1e3*e,"{hour}:{minute} {am_pm}",1e3*t,[],!n):`${m(e,t,n,r)} ${f(1e3*e,"{hour}:{minute} {am_pm}",1e3*t,[],!n)}`}function v(e,t,n,r){return(0,o.isToday)(new Date(1e3*e+1e3*t))?f(1e3*e,"{hour}:{minute} {am_pm}",1e3*t,[],!n):m(e,t,n,r)}function y(e,t,n){return(0,i.isArray)(t)&&e<t.length?t[e]:u(e,n)}function E(e,t){e+=t;var n=parseInt(Date.now()/1e3)-e,r="";if(n<60)r=h("global_just_now");else if(n<3600){r=y((0,i.intval)(n/60),h("global_word_mins_ago","raw"),h("global_mins_ago","raw"))}else if(n<14400){r=y((0,i.intval)(n/3600),h("global_word_hours_ago","raw"),h("global_hours_ago","raw"))}else r=w(e,0,!0,"_l");return r}function w(e,t,n,r){void 0===n&&(n=!0),void 0===t&&(t=0),void 0===r&&(r=""),t*=1e3;var o=new Date(1e3*e),i=new Date;return o.getFullYear()!==i.getFullYear()&&o.getTime()<i.getTime()-1728e5||Math.abs(o.getTime()-i.getTime())>157248e5?f(1e3*e,h("global_date"+r,"raw"),t,h("months_sm_of"),!n):f(1e3*e,h("global_short_date_time"+r,"raw"),t,h("months_sm_of"),!n)}function b(e,t,n){void 0===n&&(n=!0),void 0===t&&(t=0);var r=new Date,o=r.getFullYear(),i=r.getMonth(),a=new Date(1e3*e),s=a.getFullYear(),c=a.getMonth();return f(1e3*e,h(s<o&&(i>1||c<9||o-s>=2)?"global_date":"global_short_date_time","raw"),t,h("months_sm_of","raw"),!n)}},35429:(e,t,n)=>{"use strict";n.d(t,{getPageHeaderHeight:()=>y,updateNarrow:()=>E,checkPageBlocks:()=>w,redraw:()=>b,onBodyScroll:()=>C,onBodyResize:()=>S,leftBlockOver:()=>T,leftBlockOut:()=>D,leftBlockHide:()=>P,autosizeSetup:()=>A,TopMenu:()=>k,getProgressHtml:()=>I,getProgressBarEl:()=>O});n(91181),n(96253),n(83276),n(59357);var r,o=n(95724),i=n(15544),a=n(3834),s=n(47215),c=n(86409),l=n(78273),u=n(35676),d=n(49535),_=n(63604),p=n(26271),h=n(75632),f=n(50167),m=n(76270),g=n(14547),v=n(13981);n(40517),n(36680),n(19331);function y(){var e=(0,i.ge)("page_header");return r=r||(e?e.offsetHeight:0)}function E(){cur.__narrowBar=cur.__narrowBar||{},cur.__narrowBar.bar=cur.__narrowBar.bar||(0,i.ge)("narrow_column"),cur.__narrowBar.barBlock=cur.__narrowBar.bar&&(0,i.geByClass1)("page_block",cur.__narrowBar.bar),cur.__narrowBar.wideCol=cur.__narrowBar.wideCol||(0,i.ge)("wide_column"),cur.__narrowBar.isBarFixed=cur.__narrowBar.isBarFixed||"fixed"===(0,i.getStyle)(cur.__narrowBar.bar,"position"),cur.__narrowBar.pl=cur.__narrowBar.pl||(0,i.ge)("page_layout");var e=cur.__narrowBar.bar,t=cur.__narrowBar.barBlock,n=cur.__narrowBar.wideCol,r=(0,a.scrollGetY)();if(!p.browser.mobile&&e&&t&&n&&!(0,i.isVisible)(boxLoader)&&!(0,i.isVisible)(boxLayerBG)&&!(0,i.isVisible)(layerBG)){var s,c=window.lastWindowHeight||0,l=Math.min(r,bodyNode.clientHeight-c),u=cur.__narrowBar.pl,d=vk.staticheader?Math.max(0,y()-l):y(),_=cur.__narrowBar.isBarFixed,h=(0,o.floatval)((0,i.getStyle)(cur.__narrowBar.barBlock,"marginTop")),f=(0,i.getSize)(e)[1]-(_?h:0),m=(0,i.getSize)(n)[1],g=(0,i.getXY)(n)[1],v=f>=m-h,E=h,w=l+c-m-g-E,b=Math.max(0,w),C=g-d,S=(0,i.getXY)(e)[1]+(_?h:0),T=cur.__narrowBar.lastSt||0,D=cur.__narrowBar.lastStyles||{},P=d+E+f+h+b<=c&&!cur.narrowHide,A=cur.__narrowBarForceNotFixed,k=!1;l-1<C&&!(P&&p.browser.msie&&S<d+h)||v?s={marginTop:0}:!A&&(l-1<Math.min(T,S-d-h)||P)?(s={top:d,marginLeft:Math.min(-bodyNode.scrollLeft,Math.max(-bodyNode.scrollLeft,bodyNode.clientWidth-(0,i.getSize)(u)[0]))},k=!0):!A&&(l+1>Math.max(T,S+f+E-c)&&w<0&&!cur.narrowHide||cur.narrowHide&&l+1>Math.max(T,S+f-d))?(s={bottom:cur.narrowHide?c-d:E,marginLeft:Math.min(-bodyNode.scrollLeft,Math.max(-bodyNode.scrollLeft,bodyNode.clientWidth-(0,i.getSize)(u)[0]))},k=!0):s={marginTop:w>=0?m-f:Math.min(S-g,m-f+C)},function(e,t){var n=(0,o.clone)(e),r=(0,o.clone)(t);return(0,o.each)(n,(function(e,t){"position"!==e&&(n[e]=Math.round(t))})),(0,o.each)(r,(function(e,t){"position"!==e&&(r[e]=Math.round(t))})),JSON.stringify(n)===JSON.stringify(r)}(s,D)||((0,o.each)(D,(function(e){D[e]=null})),(0,i.setStyle)(e,(0,o.extend)(D,s)),cur.__narrowBar.lastStyles=s),k!==_&&(0,i.toggleClass)(e,"fixed",k),cur.__narrowBar.lastSt=l,cur.__narrowBar.isBarFixed=k}}function w(){var e=(0,i.ge)("content");e&&((0,i.toggleClass)(e,"page_block",!(0,i.geByClass1)("page_block",e)),(0,m.updateAriaElements)())}function b(e,t){e&&"fixed"===(0,i.getStyle)(e,"position")&&(t?(0,i.removeClass)(e,t):(0,i.setStyle)(e,{position:"relative"}),e.offsetLeft,t?(0,i.addClass)(e,t):(0,i.setStyle)(e,{position:"fixed"}))}function C(){if(window.pageNode){var e=Math.min(0,Math.max(-bodyNode.scrollLeft,bodyNode.clientWidth-(0,i.getSize)((0,i.ge)("page_layout"))[0]));p.browser.mobile||vk.staticheader||(0,s.updateHeaderStyles)({marginLeft:e}),(0,s.updateLeftMenu)(),E(),(0,c.updSideTopLink)()}}function S(e){if(window.pageNode){var t=document.documentElement,n=t.clientWidth,r=t.clientHeight,a=(0,c.sbWidth)(),u=Math.max((0,o.intval)(window.innerWidth),(0,o.intval)(n)),d=Math.max((0,o.intval)(window.innerHeight),(0,o.intval)(r)),h=!1;if(p.browser.mobile&&(u=Math.max(u,(0,o.intval)(bodyNode.scrollWidth)),d=Math.max(d,(0,o.intval)(bodyNode.scrollHeight))),window.lastWindowWidth!==u||!0===e){h=!0,window.lastInnerWidth=window.lastWindowWidth=u,layerWrap.style.width=boxLayerWrap.style.width=u+"px";var m=layer.style.width=boxLayer.style.width=u-a-2+"px";if(window.mvLayerWrap&&!mvcur.minimized&&(mvLayerWrap.style.width=u+"px",mvLayer.style.width=m),window.wkLayerWrap&&(wkLayerWrap.style.width=u+"px",wkLayer.style.width=m),bodyNode.offsetWidth<vk.width+a+2&&(u=vk.width+a+2),u)for(var g=pageNode.firstChild;g;g=g.nextSibling)if(g.tagName){for(var v=(window.lastInnerWidth=u-a-1)-1,y=g.firstChild;y;y=y.nextSibling)"scroll_fix"===y.className&&(y.style.width=v+"px");document.documentElement.style.setProperty("--scroll-fixed-width",`${v}px`),vk.staticheader||(0,s.updateHeaderStyles)({width:v})}}if((window.lastWindowHeight!==d||!0===e)&&(h=!0,window.lastWindowHeight=d,layerBG.style.height=boxLayerBG.style.height=layerWrap.style.height=boxLayerWrap.style.height=d+"px",window.mvLayerWrap&&!mvcur.minimized&&(mvLayerWrap.style.height=d+"px"),window.wkLayerWrap)){var w=p.browser.mobile?window.innerHeight:d;wkLayerWrap.style.height=w+"px"}if(vk.noSideTop||(0,c.updSideTopLink)(1),h&&window.curRBox&&window.curRBox.boxes&&window.getWndInner){var C=getWndInner();(0,o.each)(curRBox.boxes,((e,t)=>t._wnd_resize(C[0],C[1])))}setTimeout(l.updSeenAdsInfo,0);var S=(0,f.getAudioPlayer)();S.audioLayer&&S.audioLayer.isShown()&&S.audioLayer.updatePosition(),cur.pvShown&&window.Photoview&&setTimeout(Photoview.updatePhotoDimensions),window.tooltips&&tooltips.rePositionAll(),cur.lSTL&&(0,i.setStyle)(cur.lSTL,{width:Math.max((0,i.getXY)(cur.lSTL.el)[0],0),height:d-1}),(0,i.ge)("dev_top_nav")&&(0,i.setStyle)((0,i.ge)("dev_top_nav","left",null));var T=(0,i.geByClass)("ui_search_fixed"),D=(0,i.ge)("narrow_column");(0,o.each)(T,(function(){b(this,"ui_search_fixed"),setTimeout(b.pbind(this,"ui_search_fixed"),0)})),D&&(b(D,"fixed"),setTimeout(b.pbind(D,"fixed"),0)),(0,s.updateLeftMenu)(),E(),(0,_.updateSTL)()}}function T(e){var t=1;e.id||(e=(0,i.ge)("left_hide"+e),t=0),!t&&e.timer||(e.showing?(0,i.removeAttr)(e,"showing"):((0,u.animate)(e,{opacity:t?1:.5},200),t&&(e.showing=1))),e.timer&&(clearTimeout(e.timer),(0,i.removeAttr)(e,"timer"))}function D(e){var t=.5;e.id||(e=(0,i.ge)("left_hide"+e),t=0),e.timer=setTimeout((function(){(0,u.animate)(e,{opacity:t},200),(0,i.removeAttr)(e,"timer")}),1)}function P(e,t,n){var r={act:"hide_block",block:e,hash:t};n&&(r.block=n),ajax.post("al_index.php",r,{onDone:l.updSeenAdsInfo}),(0,i.hide)("left_block"+e)}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=(0,i.ge)(e))if(e.autosize)e.autosize.update();else{t.minHeight=(0,o.intval)(t.minHeight)||(0,o.intval)((0,i.getStyle)(e,"height")),t.maxHeight=(0,o.intval)(t.maxHeight);var n=(0,i.getSize)(e)[0]||(0,o.intval)((0,i.getStyle)(e,"width")),r=(0,i.getStyle)(e,"fontSize"),a=(0,i.getStyle)(e,"lineHeight");n<1&&(n=(0,o.intval)((0,i.getStyle)(e,"width",!1))),r.indexOf("em")>0&&(r=(0,o.floatval)(r)*vk.fs),r=(0,o.intval)(r);var s={width:n,height:10,fontFamily:(0,i.getStyle)(e,"fontFamily"),fontSize:r+"px",lineHeight:a,boxSizing:(0,i.getStyle)(e,"boxSizing")},c=["Top","Bottom","Left","Right"];(0,o.each)(c,(function(){s["padding"+this]=(0,i.getStyle)(e,"padding"+this)})),e.autosize={options:t,helper:(0,i.ce)("textarea",{className:"ashelper"},s),handleEvent:function(t,n){var r=n.charCode?String.fromCharCode(n.charCode):n.charCode;if(void 0===r&&(r=String.fromCharCode(n.keyCode),10===n.keyCode||13===n.keyCode?r="\n":!p.browser.msie&&n.keyCode<=40&&(r="")),!r)return t;if(!p.browser.msie)return t.substr(0,e.selectionStart)+r+t.substr(e.selectionEnd);var o=document.selection.createRange();return o.text&&(t=t.replace(o.text,"")),t+r},update:function(t){var n=e.value;!t||"blur"===t.type||"keyup"===t.type||p.browser.msie&&"keypress"!==t.type||t.ctrlKey||t.altKey||t.metaKey||(n=e.autosize.handleEvent(n,t)),n||(n=" "),e.autosize.helper.value!==n&&(e.autosize.helper.value=n);var r=e.autosize.options,s=(0,i.getSize)(e,!0)[1],c=e.autosize.helper.scrollHeight,l=c%a;r.exact&&l>2&&(c-=l-2),c<r.minHeight&&(c=r.minHeight);var u={overflow:"hidden"},d=(0,i.getStyle)(e,"overflow").indexOf("auto")>-1?"auto":"hidden";r.maxHeight&&c>r.maxHeight&&(c=r.maxHeight,(0,o.extend)(u,{overflow:"auto",overflowX:"hidden"})),r.addHeight&&(c+=r.addHeight),s===c&&d===u.overflow||(u.height=c,(0,i.setStyle)(e,u),(0,o.isFunction)(r.onResize)&&r.onResize(c))}},t.exact&&("normal"===a&&(a="120%"),a.indexOf("%")>0&&(a=r*(0,o.intval)(a)/100)),utilsNode.appendChild(e.autosize.helper),p.browser.opera_mobile?((0,i.setStyle)(e,{overflow:"hidden"}),e.autosize.update(),(0,d.addEvent)(e,"blur",e.autosize.update)):((0,d.addEvent)(e,"keydown keyup keypress change",e.autosize.update),setTimeout((()=>{(0,i.setStyle)(e,{overflow:"hidden",resize:"none"});var t=(0,i.val)(e);(0,i.val)(e," ",!0),(0,i.val)(e,t,!0),e.autosize.update()}),0))}}var k={init:function(){if(this.inited)return!1;var e=(0,i.ge)("top_profile_link"),t=(0,i.ge)("top_profile_menu");if(!e||!t)return!1;(0,d.addEvent)(e,"mousedown",k.clicked),this.inited=!0,(0,v.initColorSchemeDropdowns)()},clicked:function(e){return(0,d.checkEvent)(e)||"mousedown"===e.type&&(0,d.checkKeyboardEvent)(e)||k.toggle(),!1},toggle:function(e){var t,n=(0,i.ge)("top_profile_link"),r=(0,i.ge)("top_profile_menu"),o=(0,i.hasClass)(r,"shown");if(void 0===e||o!==e){void 0===e&&(e=!o);var a=null===(t=(0,i.$)("[data-warning]"))||void 0===t?void 0:t.getAttribute("data-warning");(0,i.hasClass)(r,"top_profile_menu_new")&&(e?g.vkConnectNavigationCollector.logAccountActionsOpen(a):g.vkConnectNavigationCollector.logAccountActionsClose(a)),(0,i.toggleClass)(n,"active",e),(0,i.toggleClass)(r,"shown",e),e?((0,h.cancelStackPush)("top_menu",k.toggle.bind(this,!1),!0),cur.introExitTooltipHide&&(cur.introExitTooltipHide(),delete cur.introExitTooltipHide)):(0,h.cancelStackFilter)("top_menu",!0)}},show:function(){k.hidetimer&&(clearTimeout(k.hidetimer),k.hidetimer=0),k.toggle(!0)},hide:function(){k.hidetimer||(k.hidetimer=setTimeout((function(){k.toggle(!1),k.hidetimer=0}),200))},select:function(e,t){return!!(0,d.checkEvent)(t)||(k.toggle(!1),nav.go(e,t,{noback:!0}))}};function I(e,t){return(0,i.rs)(vk.pr_tpl,{id:e||"",cls:t||""})}function O(e){return(0,i.geByClass1)("ui_progress_bar",e)}},54612:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{MessageBox:()=>MessageBox,showBox:()=>showBox,showTabbedBox:()=>showTabbedBox,showFastBox:()=>showFastBox,showCaptchaBox:()=>showCaptchaBox,showReCaptchaBox:()=>showReCaptchaBox});var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(66108),core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(96253),core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(75115),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(51876),_ui__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(86409),_debug_tools__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(87481),_dom_events__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(49535),_ui_util__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(59121),_dom__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(15544),_fx__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(35676),_utils_common__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(95724),_lang__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(86067),_shared_lib_convert__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(68040),_box_utils__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(86125),_accessibility__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(76270),_web_helpers_classnames__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(83295),_icons_desktop_getIcon24Cancel__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(20130),_icons_desktop_getIcon24BrowserBack__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(39026),_web_ui_FlatButton__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(24041),_shared_lib_dom__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(30104),_vkontakte_vkjs__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(59397);function MessageBox(_options){var defaults={title:!1,titleControls:"",containerClass:"",width:450,height:"auto",animSpeed:0,bodyStyle:{},grey:!1,white:!1,selfDestruct:!0,progress:!1,hideOnBGClick:!1,hideButtons:!1,onShow:!1,onHideAttempt:!1,onBeforeHide:!1,onHide:!1,onClean:!1,onDestroy:!1,preventHideLastWithCheck:!1,refreshCoordsOnTimeout:!1},options=(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.extend)(defaults,_options),guid=window._message_box_guid++,visible=!1,btns={ok:[],cancel:[]},boxTitleBck,retBox;options.progress||(options.progress="box_progress"+guid);var controlsStyle=options.hideButtons?' style="display: none"':"",boxContainer=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.ce)("div",{className:(0,_web_helpers_classnames__WEBPACK_IMPORTED_MODULE_17__.classNames)("popup_box_container",options.containerClass),innerHTML:`\n<div class="box_layout" onclick="boxQueue.skip=true;">\n  <div class="box_title_wrap">\n    <div class="box_x_button" aria-label="${(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("global_close")}" tabindex="0" role="button">${(0,_icons_desktop_getIcon24Cancel__WEBPACK_IMPORTED_MODULE_18__.getIcon24Cancel)().icon}</div>\n    <div class="box_title_controls"></div>\n    <div class="box_title"></div>\n  </div>\n\n  <div class="box_body"></div>\n  ${options.noControls?"":`\n  <div class="box_controls_wrap" ${controlsStyle}>\n    <div class="box_controls">\n      <div class="box_controls_buttons fl_r"></div>\n\n      <div class="progress" id="${options.progress}"></div>\n\n      <div class="box_controls_text">${options.textControls||""}</div>\n    </div>\n  <div>`}\n</div>`},{display:"none"});(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxContainer);var boxTitleWrap=boxContainer.querySelector(".box_title_wrap"),boxCloseButton=boxTitleWrap.querySelector(".box_x_button"),boxTitle=boxTitleWrap.querySelector(".box_title"),boxTitleControls=boxTitleWrap.querySelector(".box_title_controls");options.noCloseButton&&(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxCloseButton);var boxBody=boxContainer.querySelector(".box_body"),boxControlsWrap=boxContainer.querySelector(".box_controls_wrap"),boxButtons,boxProgress,boxControlsText;boxControlsWrap&&(boxButtons=boxControlsWrap.querySelector(".box_controls_buttons"),boxProgress=boxControlsWrap.querySelector(".progress"),boxControlsText=boxControlsWrap.querySelector(".box_controls_text")),boxLayer.appendChild(boxContainer),boxContainer.setAttribute("tabindex",0),boxContainer.focus(),applyBodyStyle(options.bodyStyle),refreshBox(),(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer);var emitter=new EventEmitter;function applyBodyStyle(e){if("string"==typeof e)for(var t=e.split(";"),n=0,r=t.length;n<r;n++){var o=t[n].split(":");o.length>1&&o[0].length&&(boxBody.style[(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.trim)(o[0])]=(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.trim)(o[1]),boxBody.style.setProperty&&boxBody.style.setProperty((0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.trim)(o[0]),(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.trim)(o[1]),""))}else(0,_vkontakte_vkjs__WEBPACK_IMPORTED_MODULE_16__.isObject)(e)&&Object.assign(boxBody.style,e)}function refreshBox(){boxTitleBck||(options.title?(boxTitle.innerHTML=options.title,(0,_dom__WEBPACK_IMPORTED_MODULE_8__.removeClass)(boxBody,"box_no_title"),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxTitleWrap)):((0,_dom__WEBPACK_IMPORTED_MODULE_8__.addClass)(boxBody,"box_no_title"),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxTitleWrap))),options.titleTransparent&&(boxTitleWrap.classList.add("box_title_wrap--transparent"),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxTitleWrap)),options.titleControls&&(boxTitleControls.innerHTML=options.titleControls),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.toggleClass)(boxBody,"box_no_buttons",options.hideButtons),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.toggleClass)(boxTitleWrap,"box_grey",options.grey),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.toggleClass)(boxTitleWrap,"box_white",options.white),boxContainer.style.width="string"==typeof options.width?options.width:options.width+"px",boxContainer.style.height="string"==typeof options.height?options.height:options.height+"px"}function addButtonInternal(e,t,n,r){var o;"no"===n||"gray"===n?(o=_web_ui_FlatButton__WEBPACK_IMPORTED_MODULE_15__.FlatButtonAppearance.TERTIARY,n="cancel"):(o=_web_ui_FlatButton__WEBPACK_IMPORTED_MODULE_15__.FlatButtonAppearance.PRIMARY,n="ok");var i=_web_ui_FlatButton__WEBPACK_IMPORTED_MODULE_15__.FlatButton.render({appearance:o,size:_web_ui_FlatButton__WEBPACK_IMPORTED_MODULE_15__.FlatButtonSize.M,children:e,restAttrs:{id:r}});return i.addEventListener("click",(e=>{emitter.emit(n,retBox),t.apply(null,[i,e])})),boxButtons.prepend(i),btns[n].push(i),i}function setControlsText(e){boxControlsText.innerHTML=e}function _removeButtons(){(0,_shared_lib_dom__WEBPACK_IMPORTED_MODULE_19__.emptyNode)(boxButtons),btns.ok.length=btns.cancel.length=0}var destroyMe=function(){(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(options.onClean)&&options.onClean(),(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(options.onDestroy)&&options.onDestroy(),options.noControls||_removeButtons(),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.cleanElems)(boxContainer,boxCloseButton,boxTitleWrap,options.noControls?void 0:boxControlsWrap),boxLayer.removeChild(boxContainer),delete window._message_boxes[guid]},hideMe=function(e,t,n){if(visible){visible=!1;var r=!0===e?0:options.animSpeed;options.hideOnBGClick&&(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(document,"click",boxQueue.hideBGClick),(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(options.onBeforeHide)&&options.onBeforeHide();var o=function(){boxQueue.currHiding===_message_boxes[guid]&&(boxQueue.currHiding=!1),_message_boxes[guid].shOther||e||layers.boxhide(),!t&&options.selfDestruct?destroyMe():(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxContainer),(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(options.onHide)&&options.onHide(n),retBox.emit("afterHide",retBox)};r>0?(boxQueue.currHiding=_message_boxes[guid],(0,_fx__WEBPACK_IMPORTED_MODULE_9__.fadeOut)(boxContainer,r,o)):o()}};function showMe(e,t,n){if(!visible&&window._message_boxes[guid]&&!window._message_boxes[guid].forceHide){visible=!0;var r=!0===e||t?0:options.animSpeed;if(options.hideOnBGClick&&(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.addEvent)(document,"click",boxQueue.hideBGClick),t||layers.boxshow(),boxQueue.currHiding){boxQueue.currHiding.shOther=!0;var o=boxQueue.currHiding.bodyNode.parentNode.parentNode;(0,_dom__WEBPACK_IMPORTED_MODULE_8__.data)(o,"tween").stop(!0)}r>0?(0,_fx__WEBPACK_IMPORTED_MODULE_9__.fadeIn)(boxContainer,r):(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxContainer),(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer),options.onShow&&options.onShow(n)}}return(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.addEvent)(boxCloseButton,"click",boxQueue.hideLast),retBox=window._message_boxes[guid]={guid:guid,_show:showMe,_hide:hideMe,bodyNode:boxBody,controlsTextNode:boxControlsText,titleWrap:boxTitleWrap,btns:btns,show:function(){return boxQueue._show(guid),this},progress:boxProgress,showCloseProgress:_dom__WEBPACK_IMPORTED_MODULE_8__.addClass.pbind(boxTitleWrap,"box_loading"),hideCloseProgress:_dom__WEBPACK_IMPORTED_MODULE_8__.removeClass.pbind(boxTitleWrap,"box_loading"),showProgress:function(){(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxControlsText),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxProgress)},hideProgress:function(){(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxProgress),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxControlsText)},hide:function(e){return!((0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(options.onHideAttempt)&&!options.onHideAttempt(e))&&(boxQueue._hide(guid),!0)},isVisible:function(){return visible},bodyHeight:function(){return(0,_dom__WEBPACK_IMPORTED_MODULE_8__.getStyle)(boxBody,"height")},content:function(e){return options.onClean&&options.onClean(),"string"==typeof e?boxBody.innerHTML=e:e instanceof HTMLElement&&(boxBody.innerHTML="",boxBody.appendChild(e)),options.refreshCoordsOnTimeout?setTimeout((()=>{(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer)})):(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer),boxContainer.focus(),refreshBox(),(0,_accessibility__WEBPACK_IMPORTED_MODULE_14__.updateAriaElements)(),this},emit:function(e,t){emitter.emit(e,t)},addButton:function(e,t,n,r,o){var i=addButtonInternal(e,t||this.hide,n,o);return r?i:this},setButtons:function(e,t,n,r){return _removeButtons(),e?(this.addButton(e,t),n&&this.addButton(n,r,"no"),this):this.addButton((0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("box_close"))},setControlsText:setControlsText,removeButtons:function(){return _removeButtons(),this},setBackTitle:function(e){e?(boxTitle.innerHTML='<div class="back"><span class="back__icon">'+(0,_icons_desktop_getIcon24BrowserBack__WEBPACK_IMPORTED_MODULE_20__.getIcon24BrowserBack)().icon+"</span>"+(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("global_box_title_back")+"</div>",boxTitleBck=options.title,options.title=boxTitle.innerHTML,setTimeout((function(){var t=boxTitle.querySelector(".back");t&&(t.onclick=e)}),100)):boxTitleBck&&(boxTitle.innerHTML=options.title=boxTitleBck,boxTitleBck=!1)},destroy:destroyMe,getOptions:function(){return options},on:function(e,t){emitter.on(e,t)},once:function(e,t){emitter.once(e,t)},updateBoxCoords:function(){(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer)},setOptions:function(e){return options.hideOnBGClick&&(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(document,"click",boxQueue.hideBGClick),options=(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.extend)(options,e),"bodyStyle"in e&&applyBodyStyle(options.bodyStyle),options.hideOnBGClick&&(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.addEvent)(document,"click",boxQueue.hideBGClick),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.toggle)(boxControlsWrap,!options.hideButtons),refreshBox(),options.noRefreshCoords||(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxContainer),this},evalBox:function evalBox(js,url,params){var scr="((function() { return function() { var box = this; "+(js||"")+";}; })())";if(__debugMode){var fn=eval(scr);fn.apply(this,[url,params])}else try{var _fn=eval(scr);_fn.apply(this,[url,params])}catch(e){(0,_ui_util__WEBPACK_IMPORTED_MODULE_7__.topError)(e,{dt:15,type:7,url:url,query:params?(0,_shared_lib_convert__WEBPACK_IMPORTED_MODULE_12__.toQueryString)(params):void 0,js:js}),(0,_debug_tools__WEBPACK_IMPORTED_MODULE_5__.logEvalError)(e,scr)}},preventHideLastWithCheck:options.preventHideLastWithCheck,execInline:function(e){window.vk.inline[e](this),delete window.vk.inline[e]}},retBox}function showBox(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if((0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.checkEvent)(r))return!1;var o=n.params||{};n.containerClass&&(o.containerClass=n.containerClass);var i=Date.now().toString(36);t&&(t.boxhash=i);var a=new MessageBox(o);a.boxhash=i;var s={onDone:function(r,s,c,l){if(n.preOnDone&&n.onDone&&n.onDone(a),t&&"function"==typeof t.onMessageSend&&window.WriteBox&&window.WriteBox.once("message_sended",t.onMessageSend),a.isVisible())if(__debugMode)u();else try{u()}catch(n){(0,_ui_util__WEBPACK_IMPORTED_MODULE_7__.topError)(n,{dt:15,type:103,url:e,query:(0,_shared_lib_convert__WEBPACK_IMPORTED_MODULE_12__.toQueryString)(t),answer:Array.prototype.slice.call(arguments).join("<!>")}),a.isVisible()&&a.hide()}else n.onDone&&n.onDone(a,l);function u(){(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxLayerBG),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.addClass)(bodyNode,"layers_shown"),a.setOptions({title:r,hideButtons:o.hideButtons||!1}),n.showProgress?a.show():(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(a.bodyNode),a.content(s),n.noEval?a.execInline(i):a.evalBox(c,e,t),n.onDone&&n.onDone(a,l)}},onFail:function(e){if(a.failed=!0,setTimeout(a.hide,0),(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.isFunction)(n.onFail))return n.onFail(e)},cache:n.cache,stat:n.stat,fromBox:!0};return n.prgEl&&(n.showProgress=_ui_util__WEBPACK_IMPORTED_MODULE_7__.showGlobalPrg.pbind(n.prgEl,{cls:n.prgClass,w:n.prgW,h:n.prgH,hide:!0}),n.hideProgress=_dom__WEBPACK_IMPORTED_MODULE_8__.hide.pbind("global_prg")),n.showProgress?(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.extend)(s,{showProgress:n.showProgress,hideProgress:n.hideProgress}):(a.setOptions({title:!1,hideButtons:!0}).show(),boxQueue.count()<2&&((0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(boxLayerBG),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.removeClass)(bodyNode,"layers_shown")),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(a.bodyNode),s.showProgress=function(){(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(boxLoader),(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.boxRefreshCoords)(boxLoader)},s.hideProgress=_dom__WEBPACK_IMPORTED_MODULE_8__.hide.pbind(boxLoader)),a.removeButtons().addButton((0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("global_close")),ajax.post(e,t,s),a}function showTabbedBox(e,t,n,r){return(n=n||{}).stat=n.stat||[],n.stat.push(jsc("web/box.js"),"boxes.css"),showBox(e,t,n,r)}function showFastBox(e,t,n,r,o,i){return new MessageBox("string"==typeof e?{title:e}:e).content(t).setButtons(n,r,o,i).show()}function showCaptchaBox(e,t,n,r){var o=function(t){if(!t||void 0===t.keyCode||10===t.keyCode||13===t.keyCode){var o=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("input",n.bodyNode);if((0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.trim)(o.value)||!0===t){var i=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("img",n.bodyNode)[0];(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(o),(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(i),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)((0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByClass1)("progress",n.bodyNode)),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)(o),r.onSubmit(e,o.value)}else(0,_dom__WEBPACK_IMPORTED_MODULE_8__.elfocus)(o)}},i=!!n,a=(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.intval)(t)?"":"&s=1",s=r.imgSrc||"/captcha.php?sid="+e+a;if(!i){var c=`\n<div class="captcha">\n  <div><img src="${s}"/></div>\n  <div>\n    <input type="text" class="big_text" maxlength="7" placeholder="${(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("global_captcha_input_here")}" />\n    <div class="progress" /></div>\n  </div>\n</div>`+(r.addText||"");n=showFastBox({title:(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("captcha_enter_code"),width:305,onHide:r.onHide,onDestroy:r.onDestroy||!1},c,(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("captcha_send"),(function(){n.submit()}),(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("captcha_cancel"),(function(){var e=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("input",n.bodyNode),t=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("img",n.bodyNode);(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(e),(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.removeEvent)(t),n.hide()}))}n.submit=o.pbind(!0),n.changed=!0;var l=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("input",n.bodyNode),u=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByTag1)("img",n.bodyNode);return i&&(l.value="",u.src="/captcha.php?sid="+e+a,(0,_dom__WEBPACK_IMPORTED_MODULE_8__.hide)((0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByClass1)("progress",n.bodyNode))),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.show)(l),(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.addEvent)(l,"keypress",o),(0,_dom_events__WEBPACK_IMPORTED_MODULE_6__.addEvent)(u,"click",(function(){this.src="/captcha.php?sid="+e+a+"&v="+(0,_utils_common__WEBPACK_IMPORTED_MODULE_10__.irand)(1e6,2e6)})),(0,_dom__WEBPACK_IMPORTED_MODULE_8__.elfocus)(l),n}function showReCaptchaBox(e,t,n,r){window.recaptchaResponse=function(e){r.onSubmit(e)};var o=!!n,i=!!window.grecaptcha;if(!o){i||(window.recaptchaCallback=function(){var t=(0,_box_utils__WEBPACK_IMPORTED_MODULE_13__.curBox)();if(t){var n=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByClass1)("recaptcha",t.bodyNode);n&&((0,_dom__WEBPACK_IMPORTED_MODULE_8__.val)(n,""),window.grecaptcha.render(n,{sitekey:e,callback:window.recaptchaResponse}))}},headNode.appendChild((0,_dom__WEBPACK_IMPORTED_MODULE_8__.ce)("script",{type:"text/javascript",src:"https://www.google.com/recaptcha/api.js?onload=recaptchaCallback&render=explicit&hl="+t})));var a='<div class="recaptcha"></div>'+(r.addText||"");n=showFastBox({title:(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("global_recaptcha_title"),width:354,onHide:r.onHide,onDestroy:r.onDestroy||!1},a,(0,_lang__WEBPACK_IMPORTED_MODULE_11__.getLang)("captcha_cancel"));var s=(0,_dom__WEBPACK_IMPORTED_MODULE_8__.geByClass1)("recaptcha",n.bodyNode);s.id="recaptcha"+(n.guid?n.guid:"0"),(0,_ui__WEBPACK_IMPORTED_MODULE_4__.showProgress)(s)}return o&&i?window.grecaptcha.reset():i&&window.recaptchaCallback(),n.changed=!0,n}},47215:(e,t,n)=>{"use strict";n.d(t,{initNavCounters:()=>x,updateHeaderStyles:()=>R,updateLeftMenu:()=>M,handlePageCount:()=>B,handlePageParams:()=>U,reloadCheckFlood:()=>F,globalHistoryDestroy:()=>W,showBackLink:()=>j,processDestroy:()=>V,handlePageView:()=>H,zNav:()=>K});n(30522),n(79665),n(95767),n(51876),n(21466),n(91181),n(83276),n(59357),n(66108),n(96253);var r=n(15544),o=n(95724),i=n(86067),a=n(35676),s=n(60615),c=n(78273),l=n(59121),u=n(86409),d=n(13165),_=n(54612),p=n(96011),h=n(86125),f=n(50167),m=n(25489),g=n(35093),v=n(63604),y=n(82452),E=n(30104),w=n(26330),b=n(61540),C=n(74402),S=n(62857),T=n(33304),D=n(19331),P=n(23459),A=n(73674),k=n(98966);function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(){window.vkLastNav=Date.now(),window.vkTabLoaded=Date.now()}function R(e){var t=[(0,r.ge)("dev_top_nav_wrap"),(0,r.ge)("page_header_wrap")];(0,o.each)(t,(function(t,n){n&&(0,r.setStyle)(n,e)}))}function M(e){window.__leftMenu&&window.__leftMenu.handleUpdateRequest(e)}function L(e,t,n,s,c){var l="",u="",d='<span class="inl_bl left_count_sign"></span>',_="reqs"===n||n&&n.substr&&"spr"===n.substr(0,3)?5:3,p=(0,r.geByClass1)("left_count_wrap",e);p.classList.toggle("left_count_wrap--highlighted",s);var h=(0,r.hasClass)((0,r.geByClass1)("left_row",e,"a"),"left_nav_over"),f=(0,r.geByClass1)("left_count",e,"span"),m=(0,r.val)(f);t&&((l=t.toString()).length>_&&(u=' title="'+(0,o.stripHTML)((0,i.langNumeric)(t,"%s",!0))+'"',l=".."+l.substr(l.length-_)),d=`<span class="inl_bl left_count" ${u}>${l}</span>`),(0,D.partConfigEnabled)("top_convo_list")&&"msg"===n&&window.TopMessenger&&window.TopMessenger.handleCounterUpdate(c);var g=function(){(0,r.val)(p,d),(t?r.removeClass:r.addClass)(p,"left_void"),(0,r.setStyle)(p,{opacity:""})};if(m||h)if(l)(0,a.animateCount)(f,l,{str:"auto",onDone:g});else if(h){var v=bodyNode.appendChild((0,r.se)('<span class="left_count_wrap"><span class="inl_bl left_count_sign"></span></span>'));v.classList("left_count_wrap--highlighted",s);var y=(0,r.getSize)((0,r.domFC)(v))[0];(0,r.re)(v),m&&"."===m.charAt(0)&&(0,r.val)(f,m.replace("..","")),(0,a.animate)(f,{width:y},100,g)}else(0,a.animate)(p,{opacity:0},100,g);else g(),(0,r.setStyle)(p,{opacity:0}),(0,a.animate)(p,{opacity:1},100)}function N(e,t,n){void 0===e.counts&&(e.counts={}),e.counts[t]=n}function B(e,t,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,c=(0,o.intval)(t),l=Math.max(0,c);if(N(window.vk,e,c),"ntf"===e)return window.TopNotifier.setCount(l),void window.TopNotifier.createNewEventsBox(l);if(e!==C.MARKET_EVENT_COUNTER_SECTION_ID){window.vk.onSetCount&&window.vk.onSetCount(e,t);var u=(0,r.ge)("l_"+e);if(u&&(L(u,l,e,!!a&&"msg"===e&&(0,D.partConfigEnabled)("mail_unread_counter_highlight"),"msg"===e?s:0),i&&n)){var d=c>0&&i?"?"+i:"";u.firstChild.href="/"+n+d}var _=(0,r.hasClass)((0,r.domFC)(u),"left_nav_over"),p=c>=0;!p&&_||(0,r.toggle)(u,p),"market_orders"===e&&u&&u.classList.remove("unshown")}else(0,C.updateMarketMenuEventCounter)(`#${e}`,t)}function U(e){vk.id=e.id,e.body_class!==bodyNode.className&&(bodyNode.className=e.body_class||""),(0,v.updateSTL)(),M(!0),void 0!==e.pvbig&&(vk.pvbig=e.pvbig),void 0!==e.pvdark&&(vk.pvdark=e.pvdark),cur._level=e.level,vk.id&&vk.id%1e3==1&&setTimeout((function(){window.scrollmarked={},(0,s.statlogsValueEvent)("page_scroll",0,cur.module,"0")}),300),H(e);var t=(0,r.ge)("mvk_footer_lnk");if(t){var n=`https://m.${(0,b.getHostName)()}/`;t.firstChild.href=e.mvklnk||n}if(vk.nophone=(0,o.intval)(e.nophone),vk.staticheader=(0,o.intval)(e.staticheader),vk.id){var i=(0,r.ge)("left_blocks");i&&(i.innerHTML=e.leftblocks||"")}"leftads"in e&&0!==e.leftads&&window.__adsSet(e.leftads,e.ads_section||"",e.ads_can_show,e.ads_showed);var a=locProtocol+"//"+location.host+"/";e.loc&&("?"===e.loc.charAt(0)?a+=nav.strLoc:a+=e.loc);var l=document.URL===a?"":document.URL;setTimeout(T.updateCounters.pbind(a,l),10);var u=e.counters;if(u.length){var d="",_="";(0,o.intval)(u[9])>0?(d="adsmarket",_="act=overview&status=-1"):(0,o.intval)(u[9])<-1?(u[9]=1,d="ads",_="act=a_comeback_office_redirect"):d="ads?act=office&last=1";var p=(0,r.ge)("l_set"),h=p&&p.nextSibling||!1,f=["fr","ph","vid","msg","nts","gr","vkp","wsh","ap","ads","ntf","fav","doc","apm","mk"],m=["friends","albums"+vk.id,"video","","notes","groups","vkpay","gifts.php?act=wishlist","apps",d,"feed"+((0,r.ge)("l_nwsf")?"?section=notifications":""),"pages","docs","apps_manage","market"],g=["","act=added","section=tagged","","act=comments","","tab=invitations","","",_,(0,r.ge)("l_nwsf")?"":"section=notifications","","","",""],y=!1;if(e.handlecnts){for(var E=0;E<f.length;E++)B(f[E],u[E],m[E],g[E]);for(var w=h.nextSibling;w;w=w.nextSibling){if(w.tagName&&"li"===w.tagName.toLowerCase()&&(0,r.isVisible)(w)){y=!0;break}if((0,r.hasClass)(w,"more_div"))break}(y?r.show:r.hide)(h),function(e){if(!(0,o.isObject)(e))return;Object.entries(e).forEach((e=>{var t=I(e,2),n=t[0],r=t[1],i=document.getElementById("l_app"+(0,o.intval)(n));i&&L(i,(0,o.intval)(r))}))}(u[17]),setTimeout(c.updSeenAdsInfo,0)}else for(var C=0;C<f.length;C++)vk.counts[f[C]]=u[C]}}function F(e){e=e||{};var t=w.default.get("last_reloaded")||[];t.unshift((0,o.vkNow)());var n=t.length;return n>5&&(t.splice(5,n-5),n=5),w.default.set("last_reloaded",t),!!(5===n&&t[0]-t[4]<2e4)&&((0,l.topError)('<b>Reloading error</b>, please check internet connection, <b><a href="/page-777107_43991681">clear your cache</a></b> and restart your browser.<br>If problem remains, please <a href="/support?act=new">report it here</a>.',{dt:15,type:6,msg:"Reload error, from "+(e.from||0)+", forced "+(e.force||0)+", url "+(e.url||"")+", query "+(e.query||"")}),!0)}function W(e){for(var t=0,n=globalHistory.length;t<n;t++)if(globalHistory[t].loc===e){var r=globalHistory.splice(t,1)[0];V(r.cur),r.content.innerHTML="",--t,--n}}function j(e,t,n){if(_tbLink){var i=e;if(e=(e||"").replace(/^\//,""),_tbLink.loc=e,void 0===n&&(n=0,e))for(var a=0,s=globalHistory.length;a<s;a++)if(globalHistory[a].loc===e){n=1;break}if(i){try{_tbLink.style.maxWidth=_tbLink.parentNode.offsetWidth-35+"px"}catch(e){}(0,o.extend)(_tbLink,{href:"/"+e,innerHTML:t,fast:n}),(0,r.show)(_tbLink),window._stlWas=0}else(0,r.hide)(_tbLink);(0,u.updSideTopLink)(1)}}function V(e){if(e._back&&e._back.hide&&e===cur)for(var t in e._back.hide)if(e._back.hide.hasOwnProperty(t))try{e._back.hide[t]()}catch(e){try{console.log(e.stack)}catch(e){}}if(e.destroy&&e.destroy.length)for(var n in e.destroy)if(e.destroy.hasOwnProperty(n))try{e.destroy[n](e)}catch(e){try{console.log(e.stack)}catch(e){}}}function H(e){var t=(0,r.ge)("footer_wrap"),n=(0,r.ge)("page_layout"),i=(0,r.geByClass1)("TopHomeLink"),a=void 0===e.width?vk.width:e.width,s=void 0===e.width_dec?vk.width_dec:e.width_dec,c=void 0===e.width_dec_footer?vk.width_dec_footer:e.width_dec_footer;if(vk.noleftmenu===e.noleftmenu&&vk.nobottommenu===e.nobottommenu&&vk.width===e.width&&vk.width_dec_footer===e.width_dec_footer||(vk.noleftmenu!==e.noleftmenu&&e.noleftmenu&&(0,r.hide)("side_bar"),vk.nobottommenu!==e.nobottommenu&&(e.nobottommenu?(0,r.hide)("bottom_nav"):(0,r.show)("bottom_nav")),e.noleftmenu&&e.nobottommenu?t&&((0,r.addClass)(t,"simple"),t.style.width="auto"):t&&((0,r.removeClass)(t,"simple"),t.style.width=a-c+"px")),vk.notopmenu!==e.notopmenu&&(e.notopmenu?(0,r.hide)("quick_search","qsearch_border","top_search","top_invite_link","top_menu_wrap"):(0,r.show)("quick_search","qsearch_border","top_search","top_invite_link","top_menu_wrap")),i&&e.top_home_link_class&&vk.top_home_link_class!==e.top_home_link_class&&(i.className=e.top_home_link_class),n&&(a!==vk.width||s!==vk.width_dec)){(0,E.setGlobalCustomProperty)("--layout-width",a+"px"),(0,r.ge)("page_body").style.width=a-s+"px",(0,r.ge)("ts_wrap")&&(0,r.hasClass)((0,r.ge)("ts_wrap"),"vk")&&((0,r.ge)("ts_wrap").style.width=a-191+"px"),setTimeout(u.updSideTopLink.pbind(!0),0),setTimeout(v.updateSTL,0);try{_tbLink.style.maxWidth=_tbLink.parentNode.offsetWidth-35+"px"}catch(e){}}vk.noleftmenu===e.noleftmenu||e.noleftmenu||(0,r.show)("side_bar"),e.to&&(0,r.ge)("quick_login_to")&&(0,r.val)("quick_login_to",e.to),vk.noleftmenu=e.noleftmenu,vk.nobottommenu=e.nobottommenu,vk.top_home_link_class=e.top_home_link_class,vk.notopmenu=e.notopmenu,vk.width=a,vk.width_dec=s,vk.width_dec_footer=c,vk.body_class=e.body_class,vk.staticheader=(0,o.intval)(e.staticheader),vk.no_ads=e.no_ads,vk.ad_preview=e.ad_preview}function K(e,t,n){var i=e.z,a=e.f,s=e.w,c=(i||"").match(/^([a-z_]+)(-?\d+(?:_(?:-)?\d+)?)\/?(.*)/i);if(delete e.z,delete e.f,delete e.w,t||(t={}),(0,o.isEmpty)(e)){if(a&&((0,y.handleScroll)(a),void 0===i))return!1;if(t.hist)if(i||s){if(layerQueue.back("wiki",s,(c||{})[1],(c||{})[2]))return!1}else if(!1===i&&n.w&&layerQueue.back("wiki",n.w))return!1;if(s){var l="";if(!1===i)layers.fullhide(!!t.hist&&2);else{if(s.match(/^story([0-9\-]+)_(\d+)/))return(0,d.showStory)(s);if(s.match(/^narrative([0-9\-]+)_(\d+)(?:_(\d+))?/)){var u=I(s.match(/^narrative([0-9\-]+)_(\d+)(?:_(\d+))?/),4),v=u[1],E=u[2],w=u[3];return(0,d.showNarrative)(v,E,w,"",{source:"narrative_link"})}if(s.match(/^donut_payment(-\d+)/)){var b=nav.objLoc.source,C=Number(s.match(/^donut_payment(-\d+)/)[1]);return(0,f.showDonutSubscribePopup)(null,null,C,b,"",{type:"subscribe",params:{act:"subscribe_popup"}})}if("stories"===s){if(cur.storyLayer)return cur.storyLayer.doHide(),!1}else n||(n=(0,o.clone)(nav.objLoc)),s&&(n.w=s),a&&(n.f=a),delete n.z,nav.setLoc(n),nav.objLoc.ref&&(l=nav.objLoc.ref,delete nav.objLoc.ref)}return(0,f.showWiki)({w:s},"note_new"===s,!1,{onLoaded:i&&K.pbind({z:i},(0,o.extend)(t,{queue:1})),isZnav:1,customRef:l}),!1}if("giftbox"===i)return!(0,_.showBox)("/al_gifts.php",{act:"get_gift_box",mid:t.id||0,fr:t.is&&t.id!==vk.id?0:1,link:nav.objLoc[0]},{stat:["gifts.css","ui_controls.js","ui_controls.css"],cache:1},window.event);if("validatebox"===i)return!(0,p.validateMobileBox)({closeLink:1,onDone:()=>(0,r.ge)("change_phone_wrap").parentNode.removeChild((0,r.ge)("change_phone_wrap"))});if("upload_video"===i)return VideoUpload.showBox();if(i===k.MY_QUESTIONS_BOX_URL_PARAMETER){var T=window.nav.objLoc.ref;return T?(delete window.nav.objLoc.ref,nav.setLoc(window.nav.objLoc)):T="url",(0,P.showMyQuestionsBox)({ref:T}),!1}if(!1===i||!1===s){var O=!window.wkcur||!wkcur.shown||layers.fullhide!==WkView.hide;!layers.fullhide||!O&&!1!==s||t.asBox||(!t.hist||n.z||n.w||-1!==n[0].indexOf("/")||n[0].match(/^(photo|video)(-?\d+_\d+)$/)||layerQueue.clear(),layers.fullhide(!!t.hist&&2));var x=(0,h.curBox)();return x&&x.wkRaw&&x.hide(),!1}if(i&&c){var R=function(){return delete nav.objLoc.z,nav.setLoc(nav.objLoc),!0};switch(c[1]){case"photo":return(0,f.showPhoto)(c[2],c[3],(0,o.extend)(t,{onFail:R,noHistory:!0})),!1;case"albums":return(0,f.showAlbums)(c[2],(0,o.extend)(t,{onFail:R,noHistory:!0})),!1;case"album":return(0,f.showAlbum)(c[2],(0,o.extend)(t,{onFail:R,noHistory:!0})),!1;case"tag":case"photo_tag":return(0,f.showPhotoTags)(c[2],(0,o.extend)(t,{onFail:R,noHistory:!0})),!1;case"video":case"clip":var M=c[3],L=(0,o.extend)(t,{onFail:R,noLocChange:1,focusPlay:1});if(M){var N=[],B="";if((0,o.each)(M.split("/"),(function(e,t){0===t.indexOf("pl_")?B=t:N.push(t)})),M=N.join("/"),B){B=B.substr("pl_".length);var U=cur.currentModule?cur.currentModule():cur.module;L=(0,o.extend)(L,{playlistId:B,module:U,addParams:{force_no_repeat:1,show_next:1,playlist_id:B,show_all_videos:(0,o.intval)(cur.isCatalog&&(!window.VideoPlaylist||!VideoPlaylist.getList(B)))}})}}return"clip"===c[1]&&(L.shortVideo=1),(0,m.showVideo)(c[2],M,L),!1;case"single":return void 0===s&&stManager.add(["single_pv.css",jsc("web/single_pv.js")],(0,r.ge)(i).onclick),!1;case"accept_money":return(0,g.moneyTransferBox)(c[2],c[3]),!1;case"moneysend":var F=S.MoneyTransfer.showMoneyTransferBox({to_id:c[2],from:"public_link"},{},(e=>(F.hide(),setTimeout((0,_.showFastBox)(getLang("global_error"),e).hide,2e3),delete nav.objLoc.z,nav.setLoc(nav.objLoc),!0)));return!1;case"audio_playlist":var W=I(c[2].split("_"),2),j=W[0],V=W[1],H=t.context||"";return AudioUtils.showAudioPlaylist(j,V,c[3],H,void 0,t.onDone),!1;case"article_edit":return f.openArticleEditor.apply(null,c[2].split("_")),!1;case"podcast":return stManager.add([jsc("web/podcast.js"),"page.css"],(()=>{Podcast.show(null,c[2],null,"url")})),!1;case"apps_achievements":return stManager.add([jsc("web/apps_achievements.js")],(()=>{window.AppsAchievementsPage.showFriendAchievements(c[2])})),!1;case k.ASK_QUESTION_BOX_URL_PREFIX:var G=Number(c[2]),z=window.nav.objLoc.ref;return z?(delete window.nav.objLoc.ref,nav.setLoc(window.nav.objLoc)):z="url",(0,P.showAskQuestionBox)(G,{ref:z}),!1;case"call":var q=()=>{stManager.add(["notifier.js"],(()=>{var e,t=I(c[2].split("_"),2),n=t[0],r=t[1],o=r&&r<0?Number(r):null,i=()=>{var e;return null===(e=window.Calls)||void 0===e?void 0:e.call(Number(n),!1,void 0,A.CallStatSource.LINK,o)};(null===(e=window.Calls)||void 0===e?void 0:e.initialized)?i():setTimeout(i,1500),delete nav.objLoc.z,nav.setLoc(nav.objLoc)}))};return(0,D.partConfigEnabled)("calls_open_warning_box_on_call_by_link")?(0,_.showFastBox)({title:getLang("global_warning")},getLang("calls_are_you_sure_to_call_this_user"),getLang("global_share_button_call"),(()=>{window.curBox().hide(),q()}),getLang("global_close")):q(),!1}}}}},3834:(e,t,n)=>{"use strict";n.d(t,{scrollToY:()=>s,scrollToTop:()=>c,scrollGetX:()=>l,scrollGetY:()=>u,disableBodyScroll:()=>d,enableBodyScroll:()=>_});var r=n(86409),o=n(35676),i=n(15544);function a(){return bodyNode}function s(e,t,n,c,d){if(null==t&&(t=400),"ontouchstart"in document.documentElement&&(t=0),c||(e=Math.max(0,e-(vk.staticheader?0:(0,i.getSize)("page_header_cont")[1]))),(0,i.data)(a(),"tween")&&(0,i.data)(a(),"tween").stop(!1),(0,i.data)(htmlNode,"tween")&&(0,i.data)(htmlNode,"tween").stop(!1),window.scrollAnimation=!1,t){var _=function(){window.scrollAnimation=!1,2===n&&("profile"!=cur.module&&"public"!=cur.module&&"group"!=cur.module&&"groups"!=cur.module&&"event"!=cur.module||!window.Wall||Wall.scrollCheck(!1,void 0,!0),(0,r.updSideTopLink)()),"function"==typeof d&&d()};window.scrollAnimation=!0,(0,o.animate)(htmlNode,{scrollTop:e},{duration:t,transition:o.Fx.Transitions.sineInOut,onComplete:_}),(0,o.animate)(a(),{scrollTop:e},{duration:t,transition:o.Fx.Transitions.sineInOut,onComplete:_})}else{if(n&&2!==n){"profile"!=cur.module&&"public"!=cur.module&&"group"!=cur.module&&"event"!=cur.module||!window.Wall||Wall.scrollCheck(!1,e,!0);var p=u()-e;return Math.abs(p)>6&&s(e+(p>0?6:-6),0,2,!0),(0,r.updSideTopLink)(),clearTimeout(window.scrlToTO),void(window.scrlToTO=setTimeout(s.pbind(e,100,2,!0,d),0))}window.scroll(l(),e),"function"==typeof d&&d(),n||(0,r.updSideTopLink)()}}function c(e){return s(0,e)}function l(){return window.pageXOffset||scrollNode.scrollLeft||document.documentElement.scrollLeft}function u(){return window.pageYOffset||scrollNode.scrollTop||document.documentElement.scrollTop}function d(){a().style.overflow="hidden"}function _(){a().style.overflow="auto"}},80309:(e,t,n)=>{"use strict";n.d(t,{createScroll:()=>c});var r=n(10124);function o(e,t){return bodyNode[e]||document.documentElement[e]}class i{constructor(e,t){this.el=e,this.opts=t,this.module=(0,r.createModule)({handlers:(e,t)=>{e(window,"scroll",this.onScroll.bind(this)),e(window,"resize",this.resize.bind(this))}}),this.innerHeight=window.innerHeight,this.prevScroll=this.scrollTop()}update(){}resize(){this.innerHeight=window.innerHeight}scrollTop(e){if(void 0===e)return o("scrollTop",this.el);!function(e,t,n){"scrollTop"===e&&window.scrollTo(0,t)}("scrollTop",e,this.el)}contHeight(){return o("scrollHeight")}smoothScroll(e){scrollToY(e+this.scrollTop(),300)}getContainer(){return this.el}getScroller(){return null}scrollBottom(e){if(void 0===e)return this.contHeight()-this.scrollTop()-this.getScrollHeight();var t=this.contHeight()-e-this.getScrollHeight();this.scrollTop(t)}scrollBottomFixSave(e){var t=Date.now(),n=()=>{Date.now()-t<500&&this.scrollBottom(e),window.removeEventListener("scroll",n)};window.addEventListener("scroll",n),this.scrollBottom(e)}onScroll(e){var t=this.scrollTop(),n=t-this.prevScroll,r=this.contHeight();this.opts.onScroll&&this.opts.onScroll(-n,this),this.opts.scrollChange&&this.opts.scrollChange(t),this.opts.more&&r-t<2*this.innerHeight&&this.opts.more(this),this.prevScroll=t}getScrollHeight(){return this.innerHeight}destroy(){(0,r.destroyModule)(this.module)}}class a{constructor(e,t){this.prevTop=0,this.scroll=new uiScroll(e,{hidden:void 0===t.hidden||t.hidden,shadows:t.shadows,stopScrollPropagation:!1,theme:t.scrollTheme,onmore:()=>t.more&&t.more(this),onscroll:e=>{var n=this.scrollTop(),r=this.prevTop-n;this.prevTop=n,t.scrollChange&&t.scrollChange(n),t.onScroll&&t.onScroll(r,this)}})}update(){this.scroll.update("sync")}scrollTop(e){return void 0!==e?this.scroll.scrollTop(e):this.scroll.data.scrollTop}getContainer(){return this.scroll.content}getScroller(){return this.scroll.scroller}contHeight(){return this.scroll.data.scrollHeight}smoothScroll(e){this.scroll.scrollTop(this.scrollTop()+e,300)}scrollBottom(e){return void 0!==e?this.scroll.scrollBottom(e):this.scroll.data.scrollBottom}scrollBottomFixSave(e){var t=Date.now();this.scroll.emitter.addOnceListener("resize",(()=>{Date.now()-t<500&&this.scroll&&this.scrollBottom(e)})),this.scrollBottom(e)}getScrollHeight(){return this.scroll.data.viewportHeight}destroy(){this.scroll.destroy()}}class s{constructor(e,t){this.el=e}update(){}getContainer(){return this.el}getScroller(){return null}scrollTop(e){return 0}contHeight(){return 0}smoothScroll(e){}scrollBottom(e){return 0}scrollBottomFixSave(e){}getScrollHeight(){return 0}destroy(){}}function c(e,t){return t.noScroll?new s(e):t.nativeScroll?new i(e,t):new a(e,t)}},69687:(e,t,n)=>{"use strict";n.d(t,{makeSharedState:()=>l});var r,o=n(40906),i="__SHARED_STATE_KEY";r=window.hasOwnProperty(i)?window.__SHARED_STATE_KEY:Object.create(null),Object.defineProperty(window,i,{configurable:!0,value:r});var a=()=>window.__SHARED_STATE_KEY,s=e=>a()[e],c={persistIfInitialized:!0},l=(e,t,n)=>{var r=(0,o.defaults)({},n,c),i=e in a(),l=s(e),u=i&&r.persistIfInitialized?l:t(l);((e,t)=>{a()[e]=t})(e,u);return()=>s(e)}},60615:(e,t,n)=>{"use strict";n.d(t,{statlogsValueEvent:()=>o.statlogsValueEvent,serviceTopSearch:()=>h,removeSearchPositionTracker:()=>Me,logLeftMenuClicks:()=>Le,saveSearchAttemptStats:()=>Ne});n(79665),n(95767),n(66108),n(91181),n(96253),n(30522),n(51876),n(59357);var r=n(95724),o=n(79957),i=n(22683);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=c(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function c(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u={},d="wall_users",_="wall_groups",p="search_statuses",h="top_search",f="",m="tap",g="join_group",v="leave_group",y="fave",E="unfave",w="write_msg",b="add_friend",C="remove_friend",S="restore_friend",T="show_photo",D="add",P="remove",A="play",k="pause",I="open_artist",O="open_author_group",x="open_author_user",R="open_author",M="open_store",L="show_similar",N="search_by_tag",B="edit",U="like",F="comment",W="share",j="mark_as_spam",V="stats",H="group",K="profile",G="",z="own",q="search",$="search_audio",Y="search_people",Q="search_groups",X="search_video",J="search_clips",Z="search_market",ee="search_classifieds",te="search_posts",ne="own_playlists",re="global_clips",oe="own_audios",ie="search_artists",ae="search_playlists",se="search_global_playlists",ce="search_audios",le="own_conversations",ue="own_messages",de="own_albums",_e="own_videos",pe="video_playlists",he="search_videos",fe="serps",me="SERPS_LOGS_DATA_LOCK",ve="",ye="user",Ee="group",we="event",be="public",Ce="grid",Se="list";function Te(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,c=0,l="",u=0,d=1,_=0,p=0;return e&&(isArray(n)||(n=[n]),n.some((n=>{var h,f=e.classList.contains(n)?e:gpeByClass(n,e),m=0;if(f&&(h=r?bodyNode.querySelectorAll(r):f.parentNode.children)){if((c=[...h].indexOf(f)+1)&&o)for(var g in o)if(o.hasOwnProperty(g)){var v=bodyNode.querySelectorAll(o[g]);if(v){var y=[...v].indexOf(f)+1;if(y){u=y,l=g;break}}d++,m++}if(i){var E,w=s(i);try{for(w.s();!(E=w.n()).done;){var b=E.value,C=gpeByClass(b,e);C&&(d=C.getAttribute("data-block-num"))}}catch(e){w.e(e)}finally{w.f()}}var S=a(t(f,m),2);return _=S[0],p=S[1],!0}}))),[c,_,p,l,u,d]}function De(e,t,n,r,o,i,s){if(u[e]){var c=s.target;if(c&&c.classList)switch(e){case"groups":return void function(e,t,n,r,o,i){if(!t)return;var s=i.classList,c=i.outerHTML,l=i.tagName,u=a(Te(i,(e=>{var t=e.getAttribute("id")||e.getAttribute("data-id");return[0,"-"+(t=t?t.replace("gl_groups","").replace("gl_admin",""):0)]}),["_gl_row","search_row"],"#groups_list_tab_groups ._gl_row, #groups_list_search_wrap ._gl_row, #results .search_row, #groups_list_search_wrap .search_row",{[z]:"#groups_list_tab_groups ._gl_row",[q]:"#groups_list_search_wrap ._gl_row, #groups_list_search_wrap .search_row"}),5),d=u[1],_=u[2],p=u[3],h=u[4];if(!h)return;p===z&&(r=0,o="");var w=f;if(s.contains("group_row_title")||s.contains("group_row_img")||s.contains("highlight")||s.contains("search_item_img")||"A"===l&&-1!==c.indexOf("return nav.go")){var b=gpeByClass("group_list_row",i)||gpeByClass("groups_row",i);if(!b)return;if(b.hasAttribute("data-clicked"))return;b.setAttribute("data-clicked",!0),w=m}(s.contains("flat_button")&&!s.contains("secondary")||s.contains("search_sub_button"))&&(w=g);(s.contains("flat_button")&&s.contains("secondary")||s.contains("search_unsub_button"))&&(w=v);if(p===z&&-1!==c.indexOf("GroupsList.subscribe")){if(s.contains("ui_actions_menu"))return;w=g,!cur.scrollList.deleted[-_]&&(w=v)}if(p===z&&-1!==c.indexOf("GroupsList.toggleFave")){if(s.contains("ui_actions_menu"))return;w=y,"1"===i.getAttribute("data-value")&&(w=E)}if(w===f)return;Ie(),w===m&&ke(H,e,p,h,n,t,_,d,r,o);Oe(e,p,h,w,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);case"search_communities":return void function(e,t,n,r,o,i,s){if(!t)return;var c=s.classList,l=s.outerHTML,u=s.tagName,d=a(Te(s,(e=>{var t=e.getAttribute("data-id");return t||(t=0),[0,"-"+t]}),"search_row","#results .search_row"),3),_=d[0],p=d[1],h=d[2];if(!_)return;var y=f;if(c.contains("search_item_img")||c.contains("highlight")||"A"===u&&-1!==l.indexOf("return nav.go")){var E=gpeByClass("groups_row",s);if(!E)return;if(E.hasAttribute("data-clicked"))return;E.setAttribute("data-clicked",!0),y=m}c.contains("search_sub_button")&&(y=g);c.contains("search_unsub_button")&&(y=v);if(y===f)return;Ie(),y===m&&ke(H,e,G,_,n,t,h,p,r,o);Oe(e,G,_,y,n,t,h,p,r,o,ve,"",i)}(e,t,n,r,o,i,c);case"groups_catalog":return void function(e,t,n,r,o,i){if(!t)return;var s=i.classList,c=i.outerHTML,l=i.tagName,u=a(Te(i,(e=>{var t=e.getAttribute("data-id");return t||(t=0),[0,"-"+t]}),"search_row","#results .search_row"),3),d=u[0],_=u[1],p=u[2],h=f;if(s.contains("search_item_img")||s.contains("highlight")||"A"===l&&-1!==c.indexOf("return nav.go")){var y=gpeByClass("groups_row",i);if(!y)return;if(y.hasAttribute("data-clicked"))return;y.setAttribute("data-clicked",!0),h=m}s.contains("search_sub_button")&&(h=g);s.contains("search_unsub_button")&&(h=v);if(h===f)return;Ie(),h===m&&ke(H,e,G,d,n,t,p,_,r,o);Oe(e,G,d,h,n,t,p,_,r,o,ve)}(e,t,n,r,o,c);case"events":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=i.parentElement?i.parentElement.classList:null,u=a(Te(i,(e=>{var t=e.getAttribute("data-id");return t||(t=0),[0,"-"+t]}),"search_row","#groups_list_in_tab_search_all .search_row"),3),d=u[0],_=u[1],p=u[2];if(!d)return;var h=f;if(s.contains("search_item_img")||-1!==c.indexOf("return nav.go")&&l&&l.contains("title")){var y=gpeByClass("search_row",i);if(!y)return;if(y.hasAttribute("data-clicked"))return;y.setAttribute("data-clicked",!0),h=m}s.contains("search_sub_button")&&(h=g);s.contains("search_unsub_button")&&(h=v);if(h===f)return;Ie(),h===m&&ke(H,e,G,d,n,t,p,_,r,o);Oe(e,G,d,h,n,t,p,_,r,o,ve)}(e,t,n,r,o,c);case"friends":case"user_friends":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=i.tagName,u=a(Te(i,(e=>{var t=e.getAttribute("id");return[0,t=t?t.replace("friends_user_row",""):0]}),"friends_user_row","#list_content .friends_user_row, #friends_search_cont .friends_user_row",{[z]:"#list_content .friends_user_row",[q]:"#friends_search_cont .friends_user_row"}),5),d=u[1],_=u[2],p=u[3],h=u[4];if(!h)return;var g=f;p===z&&-1!==c.indexOf("showWriteMessageBox")&&(g=w);p===z&&-1!==c.indexOf("deleteFriend")&&(g=C);p===z&&s.contains("friends_restore_link")&&(g=S);s.contains("ui_zoom_icon")&&(g=T);p===q&&i.id&&-1!==i.id.indexOf("friends_subsc")&&(g=b);p===q&&i.id&&-1!==i.id.indexOf("friends_unsubsc")&&(g=C);if(s.contains("friends_photo_img")||p===z&&"A"===l&&-1!==c.indexOf("return nav.go")||p===q&&"A"===l&&0===s.length){var v=gpeByClass("friends_user_row",i);if(!v)return;if(v.hasAttribute("data-clicked"))return;v.setAttribute("data-clicked",!0),g=m}if(g===f)return;Ie(),g===m&&ke(K,e,p,h,n,t,_,d,r,o);Oe(e,p,h,g,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);case"friends_find":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=i.parentElement?i.parentElement.classList:null;if(!t)return;var u=a(Te(i,(e=>[0,e.getAttribute("data-id")||0]),"search_row","#results .search_row"),3),d=u[0],_=u[1],p=u[2];if(!d)return;var h=f;if(s.contains("search_item_img")||-1!==c.indexOf("return nav.go")&&l&&l.contains("name")){var g=gpeByClass("people_row",i);if(!g)return;if(g.hasAttribute("data-clicked"))return;g.setAttribute("data-clicked",!0),h=m}s.contains("search_sub_button")&&(h=b);s.contains("search_unsub_button")&&(h=C);if(h===f)return;Ie(),h===m&&ke(K,e,G,d,n,t,p,_,r,o);Oe(e,G,d,h,n,t,p,_,r,o,ve)}(e,t,n,r,o,c);case"search_people":return void function(e,t,n,r,o,i,s){var c=s.classList,l=s.outerHTML,u=s.parentElement?s.parentElement.classList:null;if(!t)return;var d=a(Te(s,(e=>[0,e.getAttribute("data-id")||0]),"search_row","#results .search_row"),3),_=d[0],p=d[1],h=d[2];if(!_)return;var g=f;if(c.contains("search_item_img")||-1!==l.indexOf("return nav.go")&&u&&u.contains("name")){var v=gpeByClass("people_row",s);if(!v)return;if(v.hasAttribute("data-clicked"))return;v.setAttribute("data-clicked",!0),g=m}c.contains("search_sub_button")&&(g=b);c.contains("search_unsub_button")&&(g=C);if(g===f)return;Ie(),g===m&&ke(K,e,G,_,n,t,h,p,r,o);Oe(e,G,_,g,n,t,h,p,r,o,ve,"",i)}(e,t,n,r,o,i,c);case"search_auto":return void function(e,t,n,r,o,i,s){var c=s.classList,l=s.tagName,u=s.outerHTML,d=Te(s,(e=>{var t="",n=e.classList;if(n.contains("_audio_row"))t=e.getAttribute("data-full-id");else{if(n.contains("people_row"))return[0,t=e.getAttribute("data-id")||0];if(n.contains("groups_row"))return[0,"-"+(t=e.getAttribute("data-id")||0)];n.contains("_video_item")?t=e.getAttribute("data-id"):n.contains("ShortVideoGridItem")?t=(t=e.getAttribute("href")||"").replace("/clip",""):n.contains("SearchProduct--marketDefault")?t=(t=e.getAttribute("data-stat-item")||"").replace("market_item|","").replace("|","_"):n.contains("SearchProduct--classifiedsDefault")?t=(t=e.getAttribute("data-stat-item")||"").replace("classifieds_item|","").replace("|","_"):n.contains("_post")&&(t=(t=e.getAttribute("id")||"").replace("post",""))}return t&&t.indexOf("_")?t.split("_"):[0,t]}),["_audio_row","search_row","_video_item","ShortVideoGridItem","SearchProduct--marketDefault","SearchProduct--classifiedsDefault","_post"],"\n      ._search_results ._audio_row,\n      ._search_results .search_row,\n      ._search_results ._video_item,\n      ._search_results .ShortVideoGridItem,\n      .MarketSearchProducts .SearchProduct--marketDefault,\n      .ClassifiedsSearchProducts .SearchProduct--classifiedsDefault,\n      #results ._post\n    ",{[$]:"._search_results ._audio_row",[Y]:"._search_results .people_row",[Q]:"._search_results .groups_row",[X]:"._search_results ._video_item",[J]:"._search_results .ShortVideoGridItem",[Z]:".MarketSearchProducts .SearchProduct--marketDefault",[ee]:".ClassifiedsSearchProducts .SearchProduct--classifiedsDefault",[te]:"#results ._post"},["search_audio_media","search_people_media","search_communities_media","search_video_media","search_clips_media","search_market_media","search_classifieds_media"]),_=a(d,6),p=_[1],h=_[2],g=_[3],v=_[4],w=_[5];if(g===te){for(var S=0,T=ge("search_auto_rows"),R=0;R<T.children.length;++R){var L=T.children[R],N=intval(L.getAttribute("data-block-num"));S=Math.max(S,N)}w=S+1}if(!v)return;var B=f;switch(g){case X:c.contains("icon_add")&&(B=D),c.contains("icon_added")&&(B=P),(c.contains("video_thumb_play")||c.contains("video_item_controls")||c.contains("video_item_title"))&&(B=A),c.contains("al_need_login")&&(B=I),c.contains("group_link")&&(B=O),c.contains("mem_link")&&(B=x);break;case $:(c.contains("audio_row__play_btn")||c.contains("audio_row__performer_title")||c.contains("audio_row__performers")||c.contains("audio_row__title")||c.contains("audio_row__title_inner")||c.contains("audio_row__title_inner_subtitle")||c.contains("audio_row__inner")||c.contains("audio_player__place")||c.contains("audio_row__action_next"))&&(B=A),gpeByClass("audio_row__play_btn_icon--play",s)&&(B=A),gpeByClass("audio_row__play_btn_icon--pause",s)&&(B=k),gpeByClass("audio_row__action_add",s)&&(B=D),"A"===l&&(B=I);break;case Y:"A"===l&&-1!==u.indexOf("searcher.subscribe")&&(B=C),c.contains("add_btn")&&(B=b),(c.contains("search_item_img")||gpeByClass("name",s))&&(B=m,ke(K,e,g,v,n,t,h,p,r,o));break;case Q:(c.contains("search_item_img")||gpeByClass("title",s)||"A"===l&&-1!==u.indexOf("return nav.go"))&&(B=m,ke(H,e,g,v,n,t,h,p,r,o));break;case J:B=A;break;case Z:(c.contains("SearchProductImage__img")||c.contains("SearchProduct__title"))&&(B=m),c.contains("SearchProduct__storeName")&&(B=M);var U=gpeByClass("SearchProduct__fav",s);if(U){var F=Array.from(U.children).find((e=>e.className.includes("favorite_outline")));B=F?y:E}break;case ee:(c.contains("SearchProductImage__img")||c.contains("SearchProduct__title"))&&(B=m);var W=gpeByClass("SearchProduct__fav",s);if(W){var j=Array.from(W.children).find((e=>e.className.includes("favorite_outline")));B=j?y:E}break;case te:gpeByClass("post",s,"div#results")&&(B=m)}if(B===f)return;Oe(e,g,v,B,n,t,h,p,r,o,ve,"",i,w)}(e,t,n,r,o,i,c);case"bookmarks_groups":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=a(Te(i,(e=>{var t=e.getAttribute("data-id");return t||(t=0),[0,t]}),"_bookmark_page_item"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;if(s.contains("group_link")||s.contains("bookmark_page_item__image")){var h=gpeByClass("_bookmark_page_item",i);if(!h)return;if(h.hasAttribute("data-clicked"))return;h.setAttribute("data-clicked",!0),p=m}(s.contains("ui_zoom")||s.contains("ui_zoom_icon"))&&(p=T);-1!==c.indexOf("Bookmarks.removeBookmark")&&(p=E);if(p===f)return;Ie(),p===m&&ke(H,e,G,u,n,t,_,d,r,o);Oe(e,G,u,p,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);case"bookmarks_users":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=a(Te(i,(e=>{var t=e.getAttribute("data-id");return t||(t=0),[0,t]}),"_bookmark_page_item"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;if(s.contains("mem_link")||s.contains("bookmark_page_item__image")){var h=gpeByClass("_bookmark_page_item",i);if(!h)return;if(h.hasAttribute("data-clicked"))return;h.setAttribute("data-clicked",!0),p=m}(s.contains("ui_zoom")||s.contains("ui_zoom_icon"))&&(p=T);-1!==c.indexOf("Bookmarks.removeBookmark")&&(p=E);if(p===f)return;Ie(),p===m&&ke(K,e,G,u,n,t,_,d,r,o);Oe(e,G,u,p,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);case"search_audio":!function(e,t,n,r,o,i){var s=i.classList,c=i.tagName;if(gpeByClass("ap_layer_wrap",i))return;if(!gpeByClass("search_results",i))return;var l=a(Te(i,(e=>{var t=e.getAttribute("data-full-id");return t&&t.indexOf("_")?t.split("_"):[0,0]}),"_audio_row"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;(s.contains("audio_row__cover_icon")||s.contains("audio_row__performer_title")||s.contains("audio_row__title")||s.contains("audio_row__title_inner")||s.contains("audio_row__title_inner_subtitle")||s.contains("audio_row__inner")||s.contains("audio_player__place")||s.contains("audio_row__action_next")||s.contains("audio_row__performers"))&&(p=A);s.contains("audio_row__action_add")&&(p=D);"A"===c&&(p=I);if(p===f)return;Oe(e,G,u,p,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);break;case"search_video":return void function(e,t,n,r,o,i,s){var c=s.classList,l=a(Te(s,(e=>{var t=e.getAttribute("data-id");return t&&t.indexOf("_")?t.split("_"):[0,0]}),"_video_item","#results ._video_item"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;(c.contains("video_thumb_play")||c.contains("video_item_controls")||c.contains("video_thumb_label_item")||c.contains("video_thumb_label")||c.contains("video_item_title")||c.contains("mv_subtitle"))&&(p=A);(c.contains("icon_add")||c.contains("video_thumb_action_add")||c.contains("VideoCard__action--add"))&&(p=D);c.contains("icon_added")&&(p=P);c.contains("group_link")&&(p=O);c.contains("al_need_login")&&(p=I);c.contains("mem_link")&&(p=x);if(p===f)return;Oe(e,G,u,p,n,t,_,d,r,o,ve,"",i)}(e,t,n,r,o,i,c);case"search_clips":return void function(e,t,n,r,o,i,s){var c=s.classList,l=a(Te(s,(e=>{var t=e.parentNode.getAttribute("href");return(t=t.replace("/clip",""))&&t.indexOf("_")?t.split("_"):[0,0]}),"ShortVideoGridItem__thumb",".ShortVideoGridItem__thumb"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;c.contains("ShortVideoGridItem__thumb")&&(p=A);if(p===f)return;Oe(e,G,u,p,n,t,_,d,r,o,ve,"",i)}(e,t,n,r,o,i,c);case"audio":return void function(e,t,n,r,o,i){var s=i.classList,c=i.tagName,l=i.parentElement?i.parentElement.classList:null,u=a(Te(i,((e,t)=>{var n="";switch(t){case 1:case 4:case 2:n=e.getAttribute("data-full-id");break;case 0:case 3:case 6:n=e.getAttribute("data-raw-id")}return n&&n.indexOf("_")?n.split("_"):n?[n,0]:[0,0]}),["_audio_pl_item","audio_block_small_item","_audio_row","_video_item"],"\n        ._audio_section__search ._audio_pl_item,\n        ._audio_section__search ._audio_row,\n        ._audio_section__search .audio_block_small_item,\n        ._audio_section__search .video_item,\n        ._audio_search_blocks ._audio_row,\n        ._audio_search_blocks ._video_item,\n        ._audio_search_blocks ._audio_pl_item,\n        ._audio_search_blocks .audio_block_small_item\n      ",{[ae]:".CatalogBlock__search_global_albums ._audio_pl_item",[oe]:".CatalogBlock__search_owned_audios ._audio_row",[ce]:".CatalogBlock__search_global_audios ._audio_row",[ie]:".CatalogBlock__search_global_artists .audio_block_small_item",[re]:".CatalogBlock__search_global_clips .video_item",[ne]:'._audio_page_block__playlists_items[data-audio-context="search_owned_playlist"] ._audio_pl_item',[se]:".CatalogBlock__search_global_playlists ._audio_pl_item"}),5),d=u[1],_=u[2],p=u[3],h=u[4];if(!h)return;var m=f;s.contains("audio_row__action_more")||l&&l.contains("audio_row__actions")||(m=A);s.contains("audio_row__action_next")&&(m=A);p===oe&&s.contains("audio_row__action_recoms")&&(m=L);p===oe&&s.contains("audio_row__action_delete")&&(m=P);p===oe&&s.contains("audio_row__action_add")&&(m=D);p===ce&&s.contains("audio_row__action_add")&&(m=D);p===re&&s.contains("icon_add")&&(m=D);p===re&&s.contains("icon_added")&&(m=P);"A"===c&&(m=I);if(m===f)return;Oe(e,p,h,m,n,t,_,d,r,o,ve)}(e,t,n,r,o,c);case h:return void function(e,t,n,r,o,i){var s=i.classList,c=i;s.contains("ts_contact")||(c=gpeByClass("ts_contact",i,"div#ts_cont_wrap"));var l=Te(c,(()=>[0,(c.id||"").replace("ts_contact","")]),"ts_contact","#ts_cont_wrap .ts_contact"),u=a(l,3),d=u[0],_=u[1],p=u[2];if(!d)return;var h=m,f=ve;switch(c.getAttribute("hinttype")){case"h_friends":f=ye,s.contains("ts_contact_status")&&(h=w);break;case"h_mutual_friends":case"s_people":case"h_mail_peers":f=ye;break;case"h_vk_apps":case"h_apps":f="app";break;case"h_events":f=we;break;case"h_publics":f=be;break;case"h_visited":case"s_groups":f=Ee}Oe(e,G,d,h,n,t,p,_,r,o,f)}(e,t,n,r,o,c);case"video":return void function(e,t,n,r,o,i,s){var c=s.classList,l=a(Te(s,((e,t)=>{var n="";switch(t){case 1:case 3:n=e.getAttribute("data-id");break;case 2:n=e.getAttribute("data-name")}return n&&n.indexOf("_")?n.split("_"):[0,0]}),["video_playlist_item","_video_item","ui_gallery_item"],"\n        #video_layout_search .video_playlist_item,\n        #video_layout_search ._video_item,\n        #video_subtab_pane_search_promo_albums .ui_gallery_item\n      ",{[de]:"#video_subtab_pane_search_albums .video_playlist_item",[_e]:"#video_subtab_pane_search_videos ._video_item",[pe]:"#video_subtab_pane_search_promo_albums .ui_gallery_item",[he]:"#video_subtab_pane_search_global_videos ._video_item"}),5),u=l[1],d=l[2],_=l[3],p=l[4];if(!p)return;var h=f;(c.contains("icon_add")||c.contains("video_thumb_action_add")||c.contains("VideoCard__action--add"))&&(h=D);c.contains("icon_added")&&(h=P);_===_e&&c.contains("video_restore_act")&&(h=D);_===_e&&c.contains("video_thumb_action_delete")&&(h=P);(c.contains("video_item_title")||c.contains("video_item_controls")||c.contains("video_thumb_label_item")||c.contains("video_thumb_play"))&&(h=A);c.contains("group_link")&&(h=O);c.contains("al_need_login")&&(h=I);c.contains("mem_link")&&(h=x);h===f&&_===pe&&(c.contains("VideoCard__controlsOverlay")||c.contains("VideoCard__title")||c.contains("VideoCard__icon")||c.contains("VideoCard__controlsOverlayText"))&&(h=m);if(h===f)return;Oe(e,_,p,h,n,t,d,u,r,o,ve,"",i)}(e,t,n,r,o,i,c);case"market":case"market_groups":return void function(e,t,n,r,o,i){var s=i.classList,c=Ce;gpeByClass("market_row_line",i,".marketplace_content_search")&&(c=Se);var l=c===Ce?"_market_row":"market_row_line",u=a(Te(i,(e=>[0,e.getAttribute("data-id")||0]),l,"#marketplace_content ."+l),3),d=u[0],_=u[1],p=u[2];if(!d)return;var h=f;switch(c){case Se:(s.contains("market_row_img")||s.contains("link"))&&(h=m),s.contains("market_favourite")&&!s.contains("selected")&&(h=y),s.contains("market_favourite")&&s.contains("selected")&&(h=E),s.contains("mem_link")&&(h=x),s.contains("group_link")&&(h=O);break;case Ce:h=m,(s.contains("icon")||s.contains("fav"))&&(h=y),s.contains("market_row_user_link")&&(h=x)}if(h===f)return;Oe(e,G,d,h,n,t,p,_,r,o,ve)}(e,t,n,r,o,c);case"market_v2":return void function(e,t,n,r,o,i){var s=i.classList,c=a(Te(i,(e=>[+e.getAttribute("data-owner-id"),+e.getAttribute("data-id")]),"ClassifiedsCatalogProduct__serpItem"),3),l=c[0],u=c[1],d=c[2];if(!l)return;var _=f;s.contains("ClassifiedsCatalogProduct__serpTap")&&(_=m);s.contains("ClassifiedsCatalogProduct__serpAddFav")&&(_=y);s.contains("ClassifiedsCatalogProduct__serpRemoveFav")&&(_=E);s.contains("ClassifiedsCatalogProduct__serpOwnerGroup")&&(_=O);s.contains("ClassifiedsCatalogProduct__serpOwnerUser")&&(_=x);if(_===f)return;Oe(e,G,l,_,n,t,d,u,r,o,ve)}(e,t,n,r,o,c);case"messages":return void function(e,t,n,r,o,i){var s=a(Te(i,(e=>{var t=e.getAttribute("data-peer");return t||(t=0),[0,t]}),"_im_dialog","._im_page_dcontent ._im_dialog",{[le]:"._im_page_dcontent ._im_dialog:not(._im_search)",[ue]:"._im_page_dcontent ._im_dialog._im_search"}),5),c=s[1],l=s[2],u=s[3],d=s[4];if(!d)return;Oe(e,u,d,m,n,t,l,c,r,o,ve)}(e,t,n,r,o,c);case"docs":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML,l=a(Te(i,(e=>{var t=e.getAttribute("id");return t&&(t=t.replace("docs_file_","")),t&&t.indexOf("_")?t.split("_"):[0,0]}),"_docs_item","#docs_list ._docs_item, #docs_search_list ._docs_item",{[z]:"#docs_list ._docs_item",[q]:"#docs_search_list ._docs_item"}),5),u=l[1],d=l[2],_=l[3],p=l[4];if(!p)return;var h=f;_===q&&s.contains("docs_add_row")&&(h=D);_===z&&s.contains("docs_delete_row")&&(h=P);_===z&&-1!==c.indexOf("Docs.restoreItem")&&(h=D);_===z&&s.contains("docs_edit_row")&&(h=B);(s.contains("highlight")||s.contains("docs_item_thumb_img")||s.contains("docs_item_icon")||s.contains("docs_item_name"))&&(h=m);-1!==c.indexOf("Docs.tagSearch")&&(h=N);if(h===f)return;Oe(e,_,p,h,n,t,d,u,r,o,ve)}(e,t,n,r,o,c);case"apps_list":case"apps":return void function(e,t,n,r,o,i){var s=a(Te(i,(e=>{var t=e.getAttribute("id");return[0,t=t?t.replace("app",""):0]}),"_apps_cat_row"),3),c=s[0],l=s[1],u=s[2];if(!c)return;var d=m;if(d===f)return;Oe(e,G,c,d,n,t,u,l,r,o,ve)}(e,t,n,r,o,c);case"games_catalog":return void function(e,t,n,r,o,i){var s=i.classList,c=a(Te(i,(e=>[0,e.getAttribute("data-app-id")||0]),"GameCatalogSearchCard"),3),l=c[0],u=c[1],d=c[2];if(!l)return;var _=f;(s.contains("GameCatalogSearchCard__screenshotImg")||s.contains("GameCatalogSearchCard__run")||s.contains("GameCatalogSearchCard__avatar")||s.contains("GameCatalogSearchCard__name"))&&(_=A);if(_===f)return;Oe(e,G,l,_,n,t,d,u,r,o,ve)}(e,t,n,r,o,c);case"photos":return void function(e,t,n,r,o,i){var s=a(Te(i,(()=>{var e=i.getAttribute("href")||"",t=(e=e.replace("/photo","")).split("_");return 2!==t.length?[0,0]:[t[0],t[1]]}),"page_post_thumb_wrap","._feed_rows .page_post_thumb_wrap"),3),c=s[0],l=s[1],u=s[2];if(!c)return;Oe(e,G,c,m,n,t,u,l,r,o,ve)}(e,t,n,r,o,c);case d:case _:case"wall":case p:case"news":return void function(e,t,n,r,o,i){var s=i.classList,c=i.outerHTML;if(gpeByClass("replies",i,".post"))return;var l="feed_row",u="";e!==p&&e!==d&&e!==_||(l="post");e!==d&&e!==_||(u="#page_search_posts .post");var h=a(Te(i,(e=>{var t;if(e.classList.contains("post"))t=e;else{var n=e.getElementsByClassName("post");if(0===n.length)return[0,0];t=n[0]}if(!t)return[0,0];var r=(t.getAttribute("data-post-id")||"").split("_");return 2===r.length?r:[0,0]}),l,u),3),g=h[0],v=h[1],E=h[2];if(!g)return;var w=f;(gpeByClass("wall_text",i,".post")||s.contains("wall_text"))&&(w=m);(s.contains("author")||s.contains("post_img")||s.contains("copy_author")||s.contains("copy_post_img"))&&(w=R);(s.contains("rel_date")||s.contains("published_by_date"))&&(w=m);(gpeByClass("like",i,".post")||s.contains("like"))&&(w=U);(gpeByClass("comment",i,".post")||s.contains("comment"))&&(w=F);(gpeByClass("share",i,".post")||s.contains("share"))&&(w=W);s.contains("ui_actions_menu_item")&&-1!==c.indexOf("bookmarkPost")&&(w=y);s.contains("ui_actions_menu_item")&&-1!==c.indexOf("wall.markAsSpam")&&(w=j);if(w===f)return;Oe(e,G,g,w,n,t,E,v,r,o,ve)}(e,t,n,r,o,c);case"manage":case"apps_manage":return void function(e,t,n,r,o,i){var s=i.classList,c=i.tagName,l=a(Te(i,(e=>{var t=e.getAttribute("id");return[0,t=t?t.replace("app",""):0]}),"_apps_settings_row"),3),u=l[0],d=l[1],_=l[2];if(!u)return;var p=f;s.contains("apps_settings_stats")&&(p=V);"A"!==c&&"img"!==c||(p=m);if(p===f)return;Oe(e,G,u,p,n,t,_,d,r,o,ve)}(e,t,n,r,o,c)}}}function Pe(){var e={},t=i.vkLocalStorage.getItem(fe);if(!t)return e;try{e=JSON.parse(t)}catch(t){e={}}return e}function Ae(e){if("locked"===i.vkLocalStorage.getItem(me))setTimeout((()=>Ae(e)),100);else{i.vkLocalStorage.setItem(me,"locked");try{e()}catch(e){}i.vkLocalStorage.setItem(me,"free")}}function ke(e,t,n,r,o,a,s,c,l,u){Ae((()=>{var d=Math.round(+new Date/1e3),_=Pe();_[e]=_[e]||{};var p=Object.keys(_[e]);if(p.length>=100){var h=p[0],f=_[e][h][0];p.forEach((t=>{var n=_[e][t][0];n<f&&(f=n,h=t)})),delete _[e][h]}_[e][s]=[d,t,n,r,o,a,c,l,u],i.vkLocalStorage.setItem(fe,JSON.stringify(_))}))}function Ie(){Ae((()=>{var e=Pe();if(e){var t=Math.round(+new Date/1e3);Object.keys(e).forEach((n=>{var r=e[n];Object.keys(r).forEach((e=>{var n=r[e][0];t-n>180&&delete r[e]})),e[n]=r,0===Object.keys(r).length&&delete e[n]})),i.vkLocalStorage.setItem(fe,JSON.stringify(e))}}))}function Oe(e,t,n,r,i,a,s,c,l,u,d){var _=arguments.length>11&&void 0!==arguments[11]?arguments[11]:"",p=arguments.length>12&&void 0!==arguments[12]&&arguments[12],h=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0;if(n){var f=-(new Date).getTimezoneOffset();(0,o.statlogsValueEvent)("search_position",e,d,r,t,n,p,c,s,a,f,i,l,u,_,h)}}function xe(e,t,n,r,i,a,s,c){var l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=arguments.length>9&&void 0!==arguments[9]&&arguments[9],d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,_=-(new Date).getTimezoneOffset();(0,o.statlogsValueEvent)("search_attempts",e,u,a,r,_,n,s,i,c,t,l,d)}function Re(){for(var e in u)u.hasOwnProperty(e)&&Me(e)}function Me(e){if(u[e]){var t=u[e];removeEvent(window,"click",t),delete u[e]}}function Le(e,t){var n=t||e.target.getAttribute("data-stats-key");n&&n.length>0&&window.statlogsValueEvent("submenu_clicks",0,n)}function Ne(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"0",s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:G,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",d=arguments.length>10&&void 0!==arguments[10]&&arguments[10],_=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0;n=n?1:0,xe(e,c,o=o&&"0"!==o?o:Be(),r,a,n,i,s,l,d,_),u[e]&&Me(e);var p=De.pbind(e,r,o,i,s,d);u[e]=p,addEvent(window,"click",p,!1,!1,!0),cur.destroy||(cur.destroy=[]),cur.destroy.some((e=>e===Re))||cur.destroy.push(Re)}function Be(){return(0,r.rand)(-9223372035,9223372035).toFixed(0).concat((0,r.rand)(0,999999999).toFixed(0))}},63604:(e,t,n)=>{"use strict";n.d(t,{initStl:()=>p,updateSTL:()=>g});var r=n(86409),o=n(35429),i=n(47215),a=n(49535),s=n(3834),c=n(15544),l=n(95724),u=n(86067),d=!1,_=!0;function p(){var e={onclick:h,onmousedown:f,onmouseover:m,onmouseout:m};(0,c.val)(_stlLeft,'<div id="stl_bg"><nobr id="stl_text">'+(0,u.getLang)("global_to_top")+"</nobr></div>"),(0,l.extend)(_stlLeft,e),(0,l.extend)(_stlSide,e),window._stlBg=_stlLeft.firstChild,window._stlText=window._stlBg.firstChild,(0,a.addEvent)(window,"blur",(function(){window._wf=-1,d=!1})),(0,a.addEvent)(window,"focus",(function(){window._wf=1,d||(window.__afterFocus=!0,d=!0,setTimeout((function(){window.__afterFocus=!1}),10),_&&((0,r.sbWidth)(!0),(0,o.onBodyResize)(!0),_=!1))}))}function h(e){return(0,a.checkEvent)(e)||(0,a.cancelEvent)(e)}function f(e){if(e=e||window.event,!(0,a.checkEvent)(e)&&!__afterFocus)if(_stlWasSet&&_stlWas){var t=_stlWas;window._stlWas=0,(0,s.scrollToY)(t,0,!0,!0),(0,i.updateLeftMenu)(!0)}else 1===_stlBack?_tbLink.onclick():(window._stlWas=(0,s.scrollGetY)(),(0,s.scrollToY)(0,0,!0,!0),(0,i.updateLeftMenu)())}function m(e){var t=e?e.originalEvent||e:window.event||{},n="mouseover"===t.type&&(t.pageX>0||t.clientX>0);(0,c.toggleClass)(_stlLeft,"over",n),(0,c.toggleClass)(_stlLeft,"over_fast",n&&(0===_stlBack||_tbLink.fast)&&0===_stlWasSet),(0,c.toggleClass)(_stlSide,"over",n)}function g(){var e=window.innerWidth,t=document.documentElement.clientWidth,n=Math.max((0,l.intval)(e),(0,l.intval)(t));(0,c.toggleClass)(bodyNode,"no_stl",n<vk.width+280),(0,c.toggleClass)(bodyNode,"no_sett",n<vk.width+62)}},13165:(e,t,n)=>{"use strict";n.d(t,{showStory:()=>l,showNarrative:()=>u,storiesPreloadStatic:()=>_,sendMask:()=>h});var r=n(54612),o=n(86125),i=n(86067),a=n(35429),s=n(15544),c=!1;function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(cur.storiesNotSupported)return(0,r.showFastBox)((0,i.getLang)("global_error"),(0,i.getLang)("stories_bad_browser"));clearTimeout(c),c=setTimeout((function(){bodyNode.appendChild((0,s.ce)("div",{id:"stories_loader",innerHTML:(0,a.getProgressHtml)("stories_loader_pr","pr_baw pr_medium")+'<div class="back"></div>'}))}),1e3);var o=[jsc("web/stories.js"),"stories.css",jsc("web/emoji.js"),"videoview.js","videoplayer.css"];stManager.add(o,(function(){clearTimeout(c),(0,s.re)("stories_loader"),window.Stories.show(e,t,n)}))}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=`narrative${t}`,a=`${e}${n=n?`_${n}`:""}&${i}/${r=r||`narrative${e}_${t}`}`;l(a,o)}var d=!1;function _(){d||cur.storiesNotSupported||(d=!0,stManager.add([jsc("web/stories.js"),"stories.css",jsc("web/story_publisher.js"),"photo_editor.css"]))}var p=!1;function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];p||(p=!0,ajax.post("al_stories.php",{act:"send_mask",mask_id:e,hash:t,is_short_video:n},{loader:!0,onDone:(e,t,n,a)=>{"cant_send"===e?(0,r.showFastBox)({title:t,width:460},n,a):(0,o.showDoneBox)((0,i.getLang)("stories_mask_sent")),p=!1},onFail:()=>(p=!1,(0,r.showFastBox)({title:(0,i.getLang)("global_box_error_title")},(0,i.getLang)("global_unknown_error")),!0)}))}},76852:(e,t,n)=>{"use strict";n.d(t,{showTooltip:()=>a,showTitle:()=>s,showHint:()=>c});var r=n(15544),o=n(49535),i=n(95724);function a(e,t){(vk.loaded||t.noload)&&e&&(e.temphide||(e.temphide=function(){e.showing=!1},(0,o.addEvent)(e,"mouseout",e.temphide)),e.showing=!0,"loadingstat"!==e.tt&&(e.tt||(e.tt="loadingstat"),cur.cancelTooltip=!1,t.stat&&stManager.add(t.stat),stManager.add([jsc("web/tooltips.js"),"tooltips.css"],(function(){"loadingstat"===e.tt&&(e.tt=!1),e.showing&&!cur.cancelTooltip&&(!function(e){e.temphide&&((0,o.removeEvent)(e,"mouseout",e.temphide),(0,r.removeAttr)(e,"temphide"),(0,r.removeAttr)(e,"showing"))}(e),e.tt&&e.tt.el&&!t.force||(tooltips.create(e,t),t.onCreate&&t.onCreate()),tooltips.show(e,t))}))))}function s(e,t,n,o){e=(0,r.ge)(e);n||(n=[Math.round(20-(0,r.getSize)(e)[0]/2),8]);a(e,(0,i.extend)({text:function(){return t||e.getAttribute("data-title")},shift:n,black:1},o||{}))}function c(e,t){t=t||{};a(e=(0,r.ge)(e),(0,i.extend)({text:function(){return e.getAttribute("data-title")},dir:"auto",width:300,shift:[22,8]},t))}},89433:(e,t,n)=>{"use strict";n.d(t,{topHeaderClose:()=>_,topHeaderClearClose:()=>p,default:()=>f});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767),n(59357),n(51876),n(21466),n(83946);var r=n(15544),o=n(49535),i=n(95724),a=n(75632),s=n(86067),c=n(82452),l=n(60615);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){window.headerDestroy&&window.headerDestroy(),window.headerDestroy=e}function p(){delete window.headerDestroy}var h={searchLinkId:"ts_search_link",cache:{},lists:{},maxItems:8,init:function(){if(this.inited)return!1;var e=(0,r.ge)("ts_input"),t=(0,r.ge)("ts_cont_wrap");if(vk.id&&Chat.init(),!e)return!1;(0,o.addEvent)(e,"focus",(function(){h.deselect(),(0,i.trim)((0,r.val)(this))&&(0,r.addClass)(t.firstChild,"active"),h.toggleInput(!0)})),(0,o.addEvent)(e,"keydown",(function(n){switch(n.keyCode){case o.KEY.DOWN:case o.KEY.UP:h.moveSelection(n.keyCode),(0,o.cancelEvent)(n);break;case o.KEY.ENTER:var s=(0,r.geByClass1)("active",t);if(s)h.select(s,n);else{var c=(0,i.trim)((0,r.val)(this));c&&(e.blur(),h.clear(),h.toggleInput(!1),nav.go("/search?c[section]=auto&c[q]="+encodeURIComponent(c)))}(0,o.cancelEvent)(n);break;case o.KEY.TAB:h.clear(),h.toggleInput(!1),(0,a.cancelStackFilter)("top_search",!0)}})),vk.id&&((0,o.addEvent)(e,"keyup",(function(e){switch(e.keyCode){case o.KEY.DOWN:case o.KEY.UP:case o.KEY.ENTER:case o.KEY.ESC:(0,o.cancelEvent)(e);break;default:h.prepareRows((0,i.trim)((0,r.val)(this)))}})),(0,o.addEvent)(e,"paste",(function(){setTimeout((function(){h.prepareRows((0,i.trim)((0,r.val)(e)))}),10)})),(0,o.addEvent)(document,"mousedown",(function(e){(0,o.checkKeyboardEvent)(e)||(0,r.domClosest)("top_audio_layer_place",e.target)||(0,r.domClosest)("_ap_layer__close",e.target)||(0,r.domClosest)("layer_wrap",e.target)||(0,r.domClosest)("PortalNavigation",e.target)||(0,r.domClosest)("PortalNavigationDropdown",e.target)||_()})),this.inited=!0)},clear:function(){window.tooltips&&tooltips.destroyAll((0,r.ge)("ts_cont_wrap"));var e=(0,r.ge)("ts_input");e&&((0,r.val)(e,""),e.blur(),this.prepareRows())},select:function(e,t,n){if((0,o.checkEvent)(t))return!0;var a,s,c=(0,r.ge)("ts_input"),l=(0,i.trim)((0,r.val)(c)).length,u=e.getAttribute("hinttype");if(this.clear(),_(),l||c.blur(),n&&(0,r.hasClass)(t.target,"ts_contact_status"))return ajax.post("al_search.php",{act:"save_metrics",ql:l,mk:"chat_box"}),(null===(a=window)||void 0===a||null===(s=a.reforgedME)||void 0===s?void 0:s.selectPeer)?window.reforgedME.selectPeer(n,"global_search"):this.writeBox(n),!1;var d=nav.go(e,t,{params:{search_string:cur.tsStr||""}});return ajax.post("al_search.php",{act:"save_metrics",ql:l,mk:u}),d},deselect:function(){var e=(0,r.ge)("ts_cont_wrap");(0,i.each)((0,r.geByClass)("active",e),((e,t)=>(0,r.removeClass)(t,"active")))},itemOver:function(e,t,n){1===t&&h.deselect();var o=(0,i.inArray)(e.getAttribute("hintType"),["h_friends","h_correspondents","h_chats"]);(0,r.toggleClass)(e,"write",o),(0,r.toggleClass)(e,"active",t)},moveSelection:function(e){var t,n=(0,r.ge)("ts_cont_wrap"),i=(0,r.geByClass1)("active",n);switch(e){case o.KEY.UP:t=!!i&&(this.getNextNode(i,-1,"a")||i);break;case o.KEY.DOWN:t=i?this.getNextNode(i,1,"a")||i:n.firstChild}return this.deselect(),t&&(0,r.addClass)(t,"active"),!1},getNextNode:function(e,t,n){for(var o=e,i=(0,r.domPN)(e);;){if((o=t>0?(0,r.domNS)(o):(0,r.domPS)(o))||(o=t>0?(0,r.domFC)(i):(0,r.domLC)(i)),n&&o.tagName&&o.tagName.toLowerCase()===n||!n&&o)return o;if(o===e)return!1}},toggleInput:function(e){e=!!e;var t=(0,r.ge)("ts_cont_wrap");(0,r.isVisible)(t)!==e&&((0,r.toggle)("ts_cont_wrap",e),e&&(0,a.cancelStackPush)("top_search",(function(){var e=(0,r.ge)("ts_input");h.toggleInput(!1),e.blur()}),!0))},getList:function(e){switch(e){case"friends":return(isObject(this.lists.friends)&&!(0,i.isEmpty)(this.lists.friends)?this.lists.friends:this.topFriends)||{};case"publics":case"events":case"groups":case"apps":case"chats":case"search":return this.lists[e]||{}}return{}},onlines:function(){return window.curFastChat&&curFastChat.onlines||this.lists.onlines||{}},initFriendsList:function(){if(h.friendsLoaded)return!1;if(cur.initingFL||vk.isBanned||!vk.id)return!1;var e=function(){if(h.friendsLoaded)return!1;cur.initingFL=!0,ajax.post("al_search.php",{act:"get_pages"},{cache:1,onDone:function(e){delete cur.initingFL,h.friendsLoaded||((0,i.each)(e,(function(e,t){h.lists[e]=t,"onlines"!==e&&h.updateCache(e)})),h.friendsLoaded=!0,(0,r.val)("ts_input")||h.prepareRows(""))},onFail:function(){delete cur.initingFL}})},t=h.getList("friends");(0,i.isEmpty)(t)?(cur.initingFL=!0,ajax.post("al_search.php",{act:"get_top_friends"},{cache:1,onDone:function(t){delete cur.initingFL,h.topFriends=t,h.updateCache("friends"),h.forceUpdate=!0,h.prepareRows(cur.tsStr||""),e()},onFail:function(){delete cur.initingFL}})):(h.updateCache("friends"),h.forceUpdate=!0,h.prepareRows(cur.tsStr||""),e())},getSimilarQueries:function(e){var t,n=[e=e.toLowerCase()];return(t=(0,s.parseLatin)(e))&&n.push(t),(t=(0,s.parseLatKeys)(e))&&n.push(t),(t=(0,s.parseCyr)(e))&&n.push(t),n},searchCache:function(e,t){var n=h.getList(e);if(!t)return!1;var r=this.getSimilarQueries(t);if(void 0!==this.cache[e][t])return r;var o=this.cache[e][t]={};(0,i.each)(r,((t,r)=>{var a=this.cache[e][" "+r.charAt(0).toLowerCase()];if(a){var s=new RegExp("(^|[\\s\\-\\(\\)\\.,;|:]+)"+(0,i.escapeRE)(r),"gi");(0,i.each)(a,(e=>{var t=n[e+"_"];if(!isArray(t))return!0;null!==t[0].match(s)&&(o[e]=1)}))}}));var a=0;return(0,i.each)(o,(()=>a++)),o._num=a,r},updateCache:function(e,t,n){var r=t||this.getList(e);this.cache[e]=n&&this.cache[e]||{},(0,i.each)(r,((t,n)=>{var r=n[0],o=(0,i.intval)(t),a=r.split(/[\s\-\(\)\.,;|:]+/);(0,i.each)(a,((t,n)=>{var r=" "+n.charAt(0).toLowerCase();this.cache[e][r]=this.cache[e][r]||{},this.cache[e][r][o]=1}))}))},listSearch:function(e,t,n,r){var o=[],a={};return t?(h.searchCache(e,t),a=h.cache[e]&&h.cache[e][t]||{}):(0,i.each)(h.getList(e),(function(e){var t=(0,i.intval)(e);a[t]=1})),(0,i.each)(h.getList(e),(function(e){var t=(0,i.intval)(e),s=a[t];if((!r||!r[t])&&s)return!!n--&&void o.push([t,this])})),o},row:function(e,t,n,r,o,a,s,l,u){var d=0;if(a&&(r=r.replace(a,'$1<em class="ts_clist_hl">$2</em>')),(0,i.inArray)(s,["h_friends","h_correspondents","h_chats"])&&(d=e),l||(l=""),u=(0,i.intval)(u)){var _="";1&u&&(_+="page_verified "),2&u&&(_+="page_top_author "),u=`<div class="${_}" onmouseover="pageVerifiedTip(this, {type: ${u}, oid: ${e}})"></div>`}else u="";return`\n<a href="${t}" class="ts_contact clear_fix" id="ts_contact${e}" onclick="return TopSearch.select(this, event, ${d});" onmousedown="event.cancelBubble = true;"\n      onmouseover="TopSearch.itemOver(this, 1, event);"  onmouseout="TopSearch.itemOver(this, 0, event);" hinttype="${s}">\n  <span class="ts_contact_photo ${(0,c.onlinePlatformClass)(o)}">\n    <img class="ts_contact_img" src="${n}"/>\n  </span>\n  <span class="ts_contact_name fl_l">\n    <div class="ts_contact_title_wrap${u?" is_verified":""}">\n      <span class="ts_contact_title">${r}</span>\n    </div>${u}\n    <div class="ts_contact_info">${l}</div>\n  </span>\n  <div class="ts_contact_status"></div>\n</a>`},searchLists:function(e){return e?{friends:{order:0,count:h.maxItems-1,label:(0,s.getLang)("global_friends")},groups:{order:1,count:4,label:(0,s.getLang)("global_communities")},publics:{count:2,parent:"groups"},events:{count:1,parent:"groups"},apps:{order:2,count:1,label:(0,s.getLang)("global_apps")},vk_apps:{order:2,count:1,label:(0,s.getLang)("global_apps")},chats:{order:3,count:h.maxItems-1,label:(0,s.getLang)("global_chats")},search:{order:4,count:h.maxItems-1,label:(0,s.getLang)("head_search_results")}}:{friends:{order:0,count:h.maxItems,label:(0,s.getLang)("global_friends")}}},initListsHtml:function(){h.listsHtml=[]},addToListsHtml:function(e,t,n){var r=h.searchLists(n),o=r[(r[e]||{}).parent||e]||{},i=o.order||0,a=o.label||"";h.listsHtml[i]=h.listsHtml[i]||(n&&a?[`<div class="ts_search_sep">${a}</div>`]:[]),h.listsHtml[i].push(t)},searchLinkHtml:function(e,t,n,r){return`<a href="${(0,i.clean)(e)}" class="ts_search_link${r?" ts_search_link_sep":""} clear_fix active" id="${(0,i.clean)(n)}" onclick="return TopSearch.select(this, event);" onmousedown="event.cancelBubble = true;" onmouseover="TopSearch.itemOver(this, 1, event);" onmouseout="TopSearch.itemOver(this, 0, event);" >\n        <span class="ts_contact_name fl_l">${t}</span>\n        <div class="ts_contact_status "></div>\n      </a>`},htmlRows:function(e){var t="",n=h.listsHtml.map((e=>e.join(""))).join("");if(e){var r="#"===e[0],o=`/search?c[section]=${r?"statuses":"auto"}&c[q]=${encodeURIComponent(e)}`,i=r?(0,s.getLang)("global_news_search_results"):(0,s.getLang)("global_show_all_results");t=h.searchLinkHtml(o,i,h.searchLinkId)}return t+n},prepareRows:function(e){var t=h.maxItems,n=(0,r.ge)("ts_cont_wrap");if(!n||!vk.id)return!1;if(cur.tsStr&&cur.tsStr===e&&!h.forceUpdate)return!1;delete h.forceUpdate,h.initListsHtml();var o={};if(e){var a=[];(0,i.each)(this.getSimilarQueries(e),(function(){a.push((0,i.escapeRE)(this))})),cur.lastRe=new RegExp("([ -]|^|s|&nbsp;|\b)("+a.join("|")+")","gi"),t--}(0,i.each)(h.searchLists(e),(function(n,a){if(h.cache[n]){var s=a.count,c=h.listSearch(n,e,s,o),l=[],d=0;(0,i.isEmpty)(c)||((0,i.each)(c,((e,n)=>{if(!t||d>=s)return!1;l.push(n),t--,d++})),l.length&&(0,i.each)(l,((t,a)=>{var s=a[1],c=(0,i.intval)(a[0]),l=c>0&&h.onlines()[c],d=u(s,6),_=d[0],p=d[1],f=d[2],m=d[3],g=d[4],v=d[5],y="search"===n?m:"h_"+n,E=h.row(c,f,p,_,l,r.re,y,g,v);h.addToListsHtml(n,E,e),o[c]=1})))}})),n.innerHTML=h.htmlRows(e),e||(0,l.removeSearchPositionTracker)(l.serviceTopSearch),!t&&e&&"#"!==e[0]&&(0,l.saveSearchAttemptStats)(l.serviceTopSearch,0,!0,e),t&&e&&"#"!==e[0]&&this.hintsSearch(e,cur.lastRe||!1),e&&(cur.tsStr=e)},hintsSearch:function(e,t){var n,o=(0,r.ge)("ts_input"),a=(0,r.ge)("ts_cont_wrap"),s=+new Date;ajax.post("al_search.php",{act:"get_pages_hints",q:e},{cache:1,onDone:function(c,d){if((0,i.trim)((0,r.val)(o))!==e)return!1;if(!c)return!1;var _=h.maxItems-(0,r.geByClass)("ts_contact",a).length-1,p=_,f={};(0,i.each)(c,(function(o,a){var s=(0,i.intval)(o),c=u(a,6),l=c[0],d=c[1],p=c[2],m=c[3],g=c[4],v=c[5],y=h.searchLists(e),E=m.replace("h_",""),w=(y[E]||{}).parent||E;if(void 0===y[w]&&(w="search"),f[w]=f[w]||{},f[w][o]=a,h.lists[w]=h.lists[w]||{},h.lists[w][o]=a,(0,r.ge)("ts_contact"+s))return!0;if(!_--)return!1;var b=h.row(s,p,d,l,!1,t,m,g,v);return h.addToListsHtml(w,b,e),n=!0,!0}));var m=+new Date-s;if((0,l.saveSearchAttemptStats)(l.serviceTopSearch,0,p!==_,e,0,d,m),(0,i.each)(f,((e,t)=>h.updateCache(e,t,!0))),n){var g=(0,r.geByClass1)("active",a),v=g?g.id:"";a.innerHTML=h.htmlRows(e),v&&(0,r.ge)(v)&&(0,r.addClass)((0,r.ge)(v),"active")}}})},writeBox:function(e){window.curFastChat&&curFastChat.inited&&window.FastChat?FastChat.selectPeer(e,!1,{entrypoint:"fastchat_global_search"}):e>0&&e<2e9?window.showWriteMessageBox(!1,e):nav.go("/im?sel="+e)}};const f=h},86409:(e,t,n)=>{"use strict";n.d(t,{notaBene:()=>d,updSideTopLink:()=>_,createButton:()=>p,actionsMenuItemLocked:()=>h,lockActionsMenuItem:()=>f,unlockActionsMenuItem:()=>m,linkLocked:()=>g,lockLink:()=>v,unlockLink:()=>y,lockButton:()=>E,unlockButton:()=>w,buttonLocked:()=>b,isButtonLocked:()=>C,disableButton:()=>S,sbWidth:()=>T,isChecked:()=>D,checkbox:()=>P,disable:()=>A,radioval:()=>k,radiobtn:()=>I,showProgress:()=>O,hideProgress:()=>x,disableEl:()=>R,enableEl:()=>M,initUiHelpers:()=>L});var r=n(15544),o=n(49535),i=n(95724),a=n(3834),s=n(35676),c=n(26271),l=n(86067),u=n(24041);function d(e,t,n){if(e=(0,r.ge)(e)){n||(0,r.elfocus)(e),void 0===(0,r.data)(e,"backstyle")&&(0,r.data)(e,"backstyle",e.style.backgroundColor||"");var o=(0,r.data)(e,"back")||(0,r.data)(e,"back",(0,r.getStyle)(e,"backgroundColor")),i={notice:"var(--field_error_background)",warning:"var(--field_error_background)"};(0,r.setStyle)(e,"backgroundColor",i[t]||t||i.warning),setTimeout((()=>(0,s.animate)(e,{backgroundColor:o},300,(function(){e.style.backgroundColor=(0,r.data)(e,"backstyle")}))),400)}}function _(e){if(window.scrollNode&&!c.browser.mobile&&window._tbLink){var t=(0,r.ge)("page_body");if(t){var n=(0,r.getXY)(t),o=(0,a.scrollGetY)(),i=bodyNode.scrollLeft,u=(0,r.ge)("side_bar"),d=(0,r.isVisible)(u);if(window._stlSideTop=Math.max((d?(0,r.getSize)(u)[1]:0)-o-(c.browser.mozilla?(0,r.getXY)(pageNode)[1]:0),n[1]),e||i!=__scrLeft){var _=(0,r.ge)("page_layout"),p=vk.rtl?_.offsetLeft+_.offsetWidth:0,h=vk.rtl?(window.lastWindowWidth||0)-p:_.offsetLeft;(0,r.setStyle)(_stlLeft,{width:Math.max(h-1,0)});var f=vk.rtl?n[0]+t.offsetWidth+5:h,m=vk.rtl?p-f:n[0]-5-f;(0,r.setStyle)(_stlSide,{left:f-i,width:Math.max(m,0)}),__scrLeft=i}(0,r.setStyle)(_stlSide,{top:_stlSideTop,height:Math.max((window.lastWindowHeight||0)-_stlSideTop,0)}),__adsUpdate();var g=200,v=_tbLink.loc||_stlWas||o>g,y=o>250&&cur._regBar,E=0,w=!1;if(v){1!==_stlShown&&((0,r.show)(_stlLeft,_stlSide),(0,r.addClass)(_stlLeft,"stl_active"),(0,r.addClass)(_stlSide,"stl_active"),_stlShown=1),_tbLink.loc&&cur._noUpLink&&(o=0),_stlWas&&o>500&&(_stlWas=0),o>g?(E=(o-g)/g,(_stlWasSet||_stlBack)&&(_stlWasSet=_stlBack=0,w=1,(0,r.val)(_stlText,(0,l.getLang)("global_to_top")),(0,r.removeClass)(_stlText,"down"),(0,r.removeClass)(_stlText,"back"))):(E=(g-o)/g,_stlWas?_stlWasSet||(_stlWasSet=1,w=0,(0,r.val)(_stlText,""),(0,r.addClass)(_stlText,"down"),_stlBack&&(_stlBack=0,(0,r.removeClass)(_stlText,"back"))):_tbLink.loc&&(_stlBack||(_stlBack=1,w=_tbLink.fast?1:0,(0,r.val)(_stlText,(0,l.getLang)("global_back")),(0,r.addClass)(_stlText,"back"),_stlWasSet&&(_stlWasSet=0,(0,r.removeClass)(_stlText,"down"))))),!1!==w&&(0,r.toggleClass)(_stlLeft,"over_fast",(0,r.hasClass)(_stlLeft,"over")&&w);var b={opacity:Math.min(Math.max(E,0),1)};vk.staticheader&&(b.top=-Math.min((0,r.getSize)("page_header_cont")[1],o)),(0,r.setStyle)(_stlLeft,b)}else 0!==_stlShown&&((0,r.hide)(_stlLeft,_stlSide),_stlShown=0);vk.id||(!_regBar&&y?(_regBar=1,(0,r.val)((0,r.ge)("reg_bar_content"),cur._regBar),(0,s.animate)((0,r.ge)("reg_bar"),{top:0,transition:s.Fx.Transitions.sineInOut},400),(0,s.animate)((0,r.ge)("stl_bg"),{paddingTop:60,transition:s.Fx.Transitions.sineInOut},400)):_regBar&&!y&&(_regBar=0,(0,s.animate)((0,r.ge)("reg_bar"),{top:-56,transition:s.Fx.Transitions.sineInOut},400),(0,s.animate)((0,r.ge)("stl_bg"),{paddingTop:13,transition:s.Fx.Transitions.sineInOut},400)))}}}function p(e,t){if((e=(0,r.ge)(e))&&!e.btnevents)if((0,r.hasClass)(e,"flat_button"))(0,i.isFunction)(t)&&(e.onclick=t.pbind(e));else{var n=e.parentNode;if((0,r.hasClass)(n,"button_blue")||(0,r.hasClass)(n,"button_gray"))(0,i.isFunction)(t)&&(e.onclick=t.pbind(e));else{var a=!1;(0,o.addEvent)(e,"click mousedown mouseover mouseout",(function(i){if(!(0,r.hasClass)(n,"locked"))switch(i.type){case"click":if(!a)return;return e.className="button_hover",t(e),(0,o.cancelEvent)(i);case"mousedown":e.className="button_down";break;case"mouseover":a=!0,e.className="button_hover";break;case"mouseout":e.className="button",a=!1}})),e.btnevents=!0}}}function h(e){var t=(0,r.ge)(e);if(t)return(0,r.hasClass)(t,"ui_actions_menu_item_lock")}function f(e){if((e=(0,r.ge)(e))&&!e.classList.contains("ui_actions_menu_item_lock")){if(e.classList.contains("ui_actions_menu_item_with_icon"))return e.classList.add("ui_actions_menu_item_lock"),void O(e);if((0,r.hasClass)(e,"ui_actions_menu_item")){(0,r.data)(e,"inner",e.innerHTML),(0,r.addClass)(e,"ui_actions_menu_item_lock");var t=(0,r.ce)("div",{className:"ui_actions_menu_item_lock_text"});(0,r.val)(t,e.innerHTML),e.appendChild(t),O(e)}}}function m(e){if((e=(0,r.ge)(e))&&e.classList.contains("ui_actions_menu_item_lock"))return e.classList.contains("ui_actions_menu_item_with_icon")?(e.classList.remove("ui_actions_menu_item_lock"),void x(e)):void((e=(0,r.ge)(e))&&(0,r.hasClass)(e,"ui_actions_menu_item")&&(0,r.hasClass)(e,"ui_actions_menu_item_lock")&&((0,r.removeClass)(e,"ui_actions_menu_item_lock"),e.innerHTML=(0,r.data)(e,"inner")))}function g(e){var t=(0,r.ge)(e);if(t)return(0,r.hasClass)(t,"link_lock")}function v(e,t){var n=(0,r.ge)(e);n&&"a"===n.tagName.toLowerCase()&&!g(n)&&((0,r.addClass)(n,"link_lock"),t&&(0,i.each)(t,((e,t)=>(0,r.addClass)(n,t))))}function y(e,t){var n=(0,r.ge)(e);n&&g(n)&&((0,r.removeClass)(n,"link_lock"),t&&(0,i.each)(t,((e,t)=>(0,r.removeClass)(n,t))))}function E(e){var t=(0,r.ge)(e);if(t){if(u.FlatButton.isFlatButton(t))return u.FlatButton.lock(t);if(("button"===t.tagName.toLowerCase()||(0,r.hasClass)(t,"flat_button")||(0,r.hasClass)(t,"wr_header"))&&!C(t)){var n=(0,r.getSize)(t);(0,r.addClass)(t,"flat_btn_lock"),(0,r.data)(t,"inner",t.innerHTML),(0,r.setStyle)(t,{width:n[0],height:n[1]}),t.innerHTML="",O(t,"btn_lock")}}}function w(e){var t=(0,r.ge)(e);if(t)return u.FlatButton.isFlatButton(t)?u.FlatButton.unlock(t):void(C(t)&&(x(t),t.innerHTML=(0,r.data)(t,"inner"),(0,r.removeClass)(t,"flat_btn_lock"),(0,r.setStyle)(t,{width:null,height:null})))}function b(e){return C(e)}function C(e){var t=(0,r.ge)(e);if(t)return u.FlatButton.isFlatButton(t)?u.FlatButton.isLocked(t):(0,r.hasClass)(t,"flat_btn_lock")}function S(e,t){var n=(0,r.ge)(e);if(n&&"button"===n.tagName.toLowerCase()){if(u.FlatButton.isFlatButton(n))return u.FlatButton.setDisabled(n,t);if(t){if(!(0,r.isVisible)(n))return;n.parentNode.insertBefore((0,r.ce)("button",{innerHTML:n.innerHTML,className:n.className+" button_disabled"}),n),(0,r.hide)(n)}else{var o=(0,r.domPS)(n);o&&(0,r.hasClass)(o,"button_disabled")&&(0,r.re)(o),(0,r.show)(n)}}}function T(e){if(void 0===window._sbWidth||e){var t=(0,r.ce)("div",{innerHTML:'<div style="height: 75px;">1<br>1</div>'},{overflowY:"scroll",position:"absolute",width:"50px",height:"50px"});bodyNode.appendChild(t),window._sbWidth=Math.max(0,t.offsetWidth-t.firstChild.offsetWidth-1),bodyNode.removeChild(t)}return window._sbWidth}function D(e){return(e=(0,r.ge)(e))&&(0,r.hasClass)(e,"on")?1:""}function P(e,t){var n=(0,r.ge)(e);if(n&&!(0,r.hasClass)(n,"disabled"))return void 0===t&&(t=!D(n)),(0,r.toggleClass)(n,"on",t),n.setAttribute("aria-checked",t?"true":"false"),!1}function A(e,t){return e=(0,r.ge)(e),void 0===t&&(t=!(0,r.hasClass)(e,"disabled")),(0,r.toggleClass)(e,"disabled",t),"INPUT"===e.tagName&&(t?e.setAttribute("readonly","readonly"):e.removeAttribute("readonly")),!1}function k(e){return!!radioBtns[e]&&radioBtns[e].val}function I(e,t,n){if(radioBtns[n]&&!(0,r.hasClass)(e,"disabled"))return(0,i.each)(radioBtns[n].els,(function(){this&&(this==e?((0,r.addClass)(this,"on"),this.setAttribute("aria-checked","true"),this.setAttribute("tabindex","0")):((0,r.removeClass)(this,"on"),this.setAttribute&&(this.setAttribute("aria-checked","false"),this.setAttribute("tabindex","-1"))))})),radioBtns[n].val=t}function O(e,t,n,o){var i;if(e=(0,r.ge)(e))return(0,r.hasClass)(e,"pr")?i=e:(i=(0,r.se)((0,r.rs)(vk.pr_tpl,{id:t||"",cls:n||""})),o?(0,r.domInsertBefore)(i,e):e.appendChild(i)),setTimeout((function(){(0,r.setStyle)(i,{opacity:1})})),i}function x(e){e&&((0,r.hasClass)(e,"pr")?(0,r.setStyle)(e,{opacity:0}):(0,r.re)((0,r.geByClass1)("pr",e)))}function R(e){(0,r.setStyle)(e,"pointer-events","none")}function M(e){(0,r.setStyle)(e,"pointer-events","")}function L(){window.__scrLeft=0,window.radioBtns={}}},59121:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{topMsg:()=>topMsg,topError:()=>topError,showMsg:()=>showMsg,showGlobalPrg:()=>showGlobalPrg});var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(66108),core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(96253),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(59357),_dom__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(15544),_shared_user_user_env__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(19331),_shared_lib_js_logger__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(66433),_shared_lib_sentry_config__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9509),_utils_common__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(95724);function topMsg(e,t,n){if(n||(n="var(--content_tint_background)"),e){clearTimeout(window.topMsgTimer);var r=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.ge)("system_msg");r.style.backgroundColor=n,r.innerHTML=e,(0,_dom__WEBPACK_IMPORTED_MODULE_3__.show)(r),t&&(window.topMsgTimer=setTimeout(topMsg.pbind(!1),1e3*t))}else(0,_dom__WEBPACK_IMPORTED_MODULE_3__.hide)("system_msg")}function topError(text,opts){var prefix="VK error: ";opts||(opts={});var hasDummyStacktrace=!opts.stack;if(text.message){var error=text;text="<b>JavaScript error</b>"+((0,_shared_user_user_env__WEBPACK_IMPORTED_MODULE_4__.partConfigEnabled)("extended_client_logging")?": "+error.message:""),opts.stack=error.stack,error.stack&&__debugMode&&(text+="<br/>"+error.stack.replace(/\n/g,"<br/>"));try{console.error(prefix,error.message),console.log(error.stack)}catch(e){}}else try{console.error(prefix,text)}catch(e){}if(!opts.stack){hasDummyStacktrace=!0;try{eval("0 = 1")}catch(e){opts.stack=e.stack}}if(-1!=opts.dt&&topMsg(text,opts.dt,"#FFB4A3"),1!==opts.type&&!__dev&&!(0,_dom__WEBPACK_IMPORTED_MODULE_3__.ge)("debuglogwrap")){delete opts.dt;var breadcrumb={message:text,data:{msg:opts.msg||text,module:(window.cur||{}).module,id:vk.id,host:locHost,lang:vk.lang,loc:(window.nav||{}).strLoc,realloc:location.toString()}};(0,_shared_lib_js_logger__WEBPACK_IMPORTED_MODULE_5__.logError)(opts,{environment:_shared_lib_sentry_config__WEBPACK_IMPORTED_MODULE_6__.topErrorModuleName,breadcrumb:breadcrumb,hasDummyStacktrace:hasDummyStacktrace})}}function showMsg(e,t,n,r){var o="msg"+("msg"!==n?" "+n:"");r&&(o+=" msg_appear"),e=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.ge)(e);var i=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.geByClass1)(n,e),a=i||(0,_dom__WEBPACK_IMPORTED_MODULE_3__.domFC)(e),s=e.insertBefore((0,_dom__WEBPACK_IMPORTED_MODULE_3__.ce)("div",{className:o,innerHTML:'<div class="msg_text">'+t+"</div>"}),a);i&&(0,_dom__WEBPACK_IMPORTED_MODULE_3__.re)(i),setTimeout(_dom__WEBPACK_IMPORTED_MODULE_3__.removeClass.pbind(s,"msg_appear"),0)}function showGlobalPrg(e,t){var n=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.getXY)(e),r=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.getSize)(e),o=t||{},i=o.w,a=void 0===i?32:i,s=o.h,c=void 0===s?13:s,l=(0,_dom__WEBPACK_IMPORTED_MODULE_3__.ge)("global_prg");l.className=o.cls||"progress",(0,_dom__WEBPACK_IMPORTED_MODULE_3__.setStyle)(l,{left:n[0]+Math.floor((r[0]-a)/2)+(0,_utils_common__WEBPACK_IMPORTED_MODULE_7__.intval)(o.shift?o.shift[0]:0),top:n[1]+Math.floor((r[1]-c)/2)+(0,_utils_common__WEBPACK_IMPORTED_MODULE_7__.intval)(o.shift?o.shift[1]:0),width:a,height:c,display:"block","z-index":o.zIndex?o.zIndex:null}),o.hide&&(e.style.visibility="hidden")}},82452:(e,t,n)=>{"use strict";n.d(t,{parseJSON:()=>h.parseJSON,throttle:()=>f,shuffle:()=>m,parallel:()=>g,hashCode:()=>v,checkTextLength:()=>y,getSelectionText:()=>E,goAway:()=>w,isFullScreen:()=>b,updateMoney:()=>C,toggleOnline:()=>S,onlinePlatformClass:()=>T,handleScroll:()=>D,showErrorBox:()=>P});n(51876),n(21466),n(66108),n(91181),n(96253);var r=n(61540),o=n(95724),i=n(76567),a=n(40906),s=n(54612),c=n(15544),l=n(86067),u=n(26271),d=n(76270),_=n(49535),p=n(3834),h=(n(12439),n(20820));function f(e,t){var n;return function(){n||(e.apply(this,arguments),n=setTimeout((function(){n=!1}),t))}}function m(e){for(var t=e.length;t>0;){var n=Math.floor(Math.random()*t),r=e[--t];e[t]=e[n],e[n]=r}return e}function g(){var e=[].slice.call(arguments),t=e.pop(),n=new CallHub(t,e.length);(0,o.each)(e,((e,t)=>t((()=>n.done()))))}function v(e){var t=0;if(0===e.length)return t;for(var n=0,r=e.length;n<r;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t}function y(e,t,n,r,o,i,a){var s=t.getValue?t.getValue():t.value,u=t.lastLen||0;if(t.lastLen!==s.length||i){t.lastLen=s.length;var d={"&":5,"<":4,">":4,'"':6,"\n":r?1:4,"\r":0,"!":5,"'":5,$:6,"\\":6},_={1168:1,1169:1,8211:1,8212:1,8216:1,8217:1,8218:1,8230:1,8240:1,8249:1,8250:1,8364:1,8470:1,8482:1,65533:1},p={1037:1,1104:1,1117:1};o&&(d[","]=5);var h=function(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=d[e.charAt(n)],i=e.charCodeAt(n);t+=void 0!==o?o:!a&&i>=128&&(i<1025||p[i]||i>1119)&&!_[i]&&(i<8220||i>8222)&&(i<8224||i>8226)?("&#"+i+";").length:1}return t}(s);if(n=(0,c.ge)(n),h>Math.max(e-100,.75*e))if((0,c.show)(n),h>e)if(o){var f=(0,c.val)(t,function(e,t){for(var n=0,r="",o=0,i=e.length;o<i;o++){var s=e.charAt(o),c=d[s],l=e.charCodeAt(o);if((n+=void 0!==c?c:!a&&l>=128&&(l<1025||p[l]||l>1119)&&!_[l]&&(l<8220||l>8222)&&(l<8224||l>8226)?("&#"+l+";").length:1)>t)break;r+=s}return r}(s,Math.min(e,u)));t.lastLen=f.length,n.innerHTML=(0,l.getLang)("text_N_symbols_remain",0)}else n.innerHTML=(0,l.getLang)("text_exceeds_symbol_limit",h-e);else n.innerHTML=(0,l.getLang)("text_N_symbols_remain",e-h);else(0,c.hide)(n)}}function E(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function w(e,t,n){if(-1!==(t||{}).h||(0,_.checkEvent)(n))return!0;if(-1!==(t||{}).h){var c=e.match(r.VK_URL_REGEX_STRICT);if(c&&"api."!==c[1].toLowerCase())return location.href=e,!1;var l=(0,o.intval)((0,i.getCookie)("remixsettings_bits"));if(r.VK_URL_REGEX_STRICT.test((0,a.locBase)())||1&l)return window.open("/away.php?to="+encodeURIComponent(e)+(t&&void 0!==t.h?"&h="+t.h:""),"_blank"),!1}var u=(0,o.extend)({act:"a_go",to:e},t||{});return!(0,s.showBox)("away.php",u,{},n)}function b(){return!!(document.fullscreenElement||document.fullScreenElement||document.msFullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||cur.pvPartScreen)}function C(e,t){if(void 0!==e&&!1!==e){var n="";!0===t?(vk.balanceEx=e,n="_ex"):vk.balance=e;var r=(0,c.geByClass)("votes_balance_nom"+n);(0,o.each)(r,((t,n)=>n.innerHTML=`${e} ${(0,l.getLang)("votes_flex",e)}`));var i=e*(vk.vcost||7),a=(0,c.geByClass)("money_balance_nom"+n);(0,o.each)(a,((e,t)=>t.innerHTML=(0,l.getLang)("global_money_amount_rub",i,!0))),void 0!==t&&!1!==t&&!0!==t&&C(t,!0),window.GamesCatalog&&window.GamesCatalog.updateMoney(e)}}function S(e,t){var n=T(t).split(" "),r=[];["online","mobile","_online"].forEach((function(t){(0,o.inArray)(t,n)&&!(0,c.hasClass)(e,t)?r.push(t):!(0,o.inArray)(t,n)&&(0,c.hasClass)(e,t)&&(0,c.removeClass)(e,t)})),r.length>0&&(0,c.addClass)(e,r.join(" "))}function T(e){var t=" _online";return e&&(t+=" online"),u.mobPlatforms[e]&&(t+=" mobile"),(0,d.updateOnlineText)(),t}function D(e){e=e.split(",");var t=cur.named||{},n=e[0]&&(t[e[0]]||(0,c.ge)(e[0]))||!1,r=e[1]&&(t[e[1]]||(0,c.ge)(e[1]))||!1;if(!n&&!r){if(!(n=document.getElementsByName(e[0])[0]))return;n=n.nextSibling}var o=(0,c.ge)("page_header_wrap")||(0,c.ge)("dev_top_nav_wrap");setTimeout((function(){n&&(0,p.scrollToY)((0,c.getXY)(n)[1]-(o?(0,c.getSize)(o)[1]:0),0),r&&(0,c.elfocus)(r)}),300)}function P(e,t){return void 0===t&&(t=1e4),setTimeout((0,s.showFastBox)({title:(0,l.getLang)("global_error")},e).hide,t)}},95724:(e,t,n)=>{"use strict";n.d(t,{rand:()=>a.rand,replaceEntities:()=>a.replaceEntities,isArray:()=>a.isArray,isEmpty:()=>a.isEmpty,isFunction:()=>a.isFunction,isObject:()=>a.isObject,isString:()=>a.isString,isUndefined:()=>a.isUndefined,irand:()=>a.irand,escapeRE:()=>a.escapeRE,each:()=>a.each,vkNow:()=>a.vkNow,vkLocal:()=>c,lTimeout:()=>l,vkImage:()=>u,trim:()=>d,stripHTML:()=>_,intval:()=>p,floatval:()=>h,positive:()=>f,isNumeric:()=>m,winToUtf:()=>g,clean:()=>v,unclean:()=>y,indexOf:()=>E,inArray:()=>w,clone:()=>b,arrayKeyDiff:()=>C,extend:()=>S,addTemplates:()=>T,getTemplate:()=>D,serializeForm:()=>P,extractUrls:()=>A,isRetina:()=>k,formatCount:()=>I,encodeHtml:()=>N,decodeHtml:()=>B,initUtilsCommon:()=>U});n(30522),n(91181),n(79665),n(95767),n(66108),n(96253),n(21466),n(59357);var r=n(15544),o=n(86067),i=n(26271),a=n(40906);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e){var t=PageID;return function(){t===PageID&&e.apply(this,arguments)}}function l(e,t){return setTimeout(c(e),t)}var u=()=>window.Image?new Image:(0,r.ce)("img"),d=e=>(e||"").replace(/^\s+|\s+$/g,""),_=e=>e?e.replace(/<(?:.|\n|\r|\u2028|\u2029)*?>/g,""):"";function p(e){return!0===e?1:parseInt(e)||0}function h(e){return!0===e?1:parseFloat(e)||0}function f(e){return(e=p(e))<0?0:e}function m(e){return!isNaN(e)}function g(e){return e.replace(/&#(\d\d+);/g,(function(e,t){return(t=p(t))>=32?String.fromCharCode(t):e})).replace(/&quot;/gi,'"').replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&amp;/gi,"&")}function v(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}function y(e){return(0,a.replaceEntities)(e.replace(/\t/g,"\n"))}function E(e,t,n){for(var r=n||0,o=(e||[]).length;r<o;r++)if(e[r]==t)return r;return-1}function w(e,t){return-1!==E(t,e)}function b(e,t){var n=(0,a.isObject)(e)||void 0===e.length?{}:[];for(var r in e)(!/webkit/i.test(_ua)||"layerX"!=r&&"layerY"!=r&&"webkitMovementX"!=r&&"webkitMovementY"!=r)&&(t&&"object"==typeof e[r]&&"prototype"!==r&&null!==e[r]?n[r]=b(e[r]):n[r]=e[r]);return n}function C(e){var t={},n=arguments.length,r=arguments;for(var o in e)if(e.hasOwnProperty(o)){for(var i=!1,a=1;a<n;a++)r[a][o]&&r[a][o]===e[o]&&(i=!0);i||(t[o]=e[o])}return t}function S(){var e=arguments,t=e.length,n=e[0]||{},r=1,o=!1;for("boolean"==typeof n&&(o=n,n=e[1]||{},r=2),"object"==typeof n||(0,a.isFunction)(n)||(n={});r<t;r++){var i=e[r];if(null!=i)for(var s in i)if(i.hasOwnProperty(s)){var c=n[s],l=i[s];n!==l&&(o&&l&&"object"==typeof l&&!l.nodeType?n[s]=S(o,c||(null!=l.length?[]:{}),l):void 0!==l&&(n[s]=l))}}return n}function T(e){window.templates=window.templates||{},S(window.templates,e)}function D(e,t){var n=(window.templates=window.templates||{})[e];return"function"==typeof n&&(n=n()),n&&t?(0,r.rs)(n,t):n||""}function P(e){if("object"!=typeof e)return!1;var t={},n=t=>(0,r.geByTag)(t,e),o=function(n,o){if(o.name)if("text"!==o.type&&o.type)if(o.getAttribute("bool")){var a=(0,r.val)(o);if(!a||"0"===a)return;t[o.name]=1}else t[o.name]=i.browser.msie&&!o.value&&e[o.name]?e[o.name].value:o.value;else t[o.name]=(0,r.val)(o)};return(0,a.each)(n("input"),(function(e,t){if("radio"!==t.type&&"checkbox"!==t.type||t.checked)return o(0,t)})),(0,a.each)(n("select"),o),(0,a.each)(n("textarea"),o),t}function A(e,t){for(var n,r=t?/(?:([!()?., \n\r\t \u00A0]|^)((https?:\/\/)?((?:[a-z0-9_\-]+\.)+(?:[a-z]{2,10}|xn--p1ai|xn--j1amh|xn--80asehdb|xn--80aswg))(\/.*?)?(\#.*?)?)(?:[\.!:;,\*\(\)&]*(&nbsp;|[ \t\r\n \u00A0]|$))|([!()?., \n\r\t \u00A0]|^)((https?:\/\/)?((?:[a-z0-9а-яєґї_\-]+\.)+(?:рф|укр|онлайн|сайт|срб))(\/.*?)?(\#.*?)?)(?:[\.!:;,\*\(\)&]*(&nbsp;|[ \t\r\n \u00A0]|$)))/i:/(?:([!()?., \n\r\t \u00A0]|^)((https?:\/\/)?((?:[a-z0-9_\-]+\.)+(?:[a-z]{2,10}|xn--p1ai|xn--j1amh|xn--80asehdb|xn--80aswg))(\/.*?)?(\#.*?)?)(?:[\.!:;,\*\(\)]*(&nbsp;|[ \t\r\n \u00A0]))|([!()?., \n\r\t \u00A0]|^)((https?:\/\/)?((?:[a-z0-9а-яєґї_\-]+\.)+(?:рф|укр|онлайн|сайт|срб))(\/.*?)?(\#.*?)?)(?:[\.!:;,\*\(\)]*(&nbsp;|[ \t\r\n \u00A0])))/i,o=[];e&&(n=e.match(r));){e=e.substr(n.index+n[0].length);var i=0;n[4]||(i=7),o.push({url:n[2+i],query:n[5+i]||"",domain:n[4+i]})}return o}var k=()=>window.devicePixelRatio>=2;function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.kLimit||1e3,r=t.mLimit||1e6;return e>=r&&!t.noCheck?I(e=(e=p(e/1e5))>1e3?p(e/10):e/10,S(t,{noCheck:!0}),!0)+"M":e>=n&&!t.noCheck?I(e=(e=p(e/100))>100?p(e/10):e/10,S(t,{noCheck:!0}),!0)+"K":(0,o.langNumeric)(e,"%s",!0).replace(/,/g,".")}var O,x,R,M=(R=null,[function(e){return R||(R=(0,r.se)("<span> </span>")),R.innerText=e,R.innerHTML},function(e){return R||(R=(0,r.se)("<span> </span>")),R.innerHTML=e.replace(/<br\s*\/?>/gim,"\n"),R.innerText}]),L=(x=2,function(e){if(Array.isArray(e))return e}(O=M)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(O,x)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(O,x)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),N=L[0],B=L[1];function U(){window.PageID=window.PageID||1}},85048:(e,t,n)=>{"use strict";n.d(t,{isEmail:()=>o});n(21466);var r=/^\S+@\S+\.\S+$/;var o=e=>(e=trim(e),Boolean(e.match(r)))},25489:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{showVideo:()=>showVideo,showInlineVideo:()=>showInlineVideo,loadInlineVideo:()=>loadInlineVideo,revertLastInlineVideo:()=>revertLastInlineVideo,pauseLastInlineVideo:()=>pauseLastInlineVideo,playLastInlineVideo:()=>playLastInlineVideo,checkMp4:()=>checkMp4,VideoConstants:()=>VideoConstants,initVideo:()=>initVideo});var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(75115),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(51876),_videoplayer_lib_player_states__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(41454),_dom_events__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(49535),_utils_common__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(95724),_dom__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(15544),_lang__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(86067),_message_box__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(54612),_layout_utils__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(35429),_web_unauthorized_unauthorized__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(73271),_web_video_video_utils__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(8046),_shared_lib_site__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(61540);function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(this,arguments)}var rtrgQuery=`//${(0,_shared_lib_site__WEBPACK_IMPORTED_MODULE_9__.getHostName)()}/rtrg?r=w*Z1Flwi3QdbWaoLMc7zOA*7Cr4Nrtojr9otHjsjIhsb2CVqRWalgbvxZw3MzxZa6be3Siu2XY3gvK5fysYtWLWgNwHMpjRTupSGZrcGRNlj7fduqq9*t7ij6CX4aMcBTD5be8mIXJsbTsvP8Zl2RZEd76a4FTuCOFqzMxqGtFc-`;function showVideo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(cur.viewAsBox)return cur.viewAsBox();if(!(0,_dom_events__WEBPACK_IMPORTED_MODULE_2__.checkEvent)(r)){if((0,_web_unauthorized_unauthorized__WEBPACK_IMPORTED_MODULE_8__.isUnauthorizedMediaLayerBoxAvailable)()&&(r||n.openInPopup)&&!n.forceUnauth&&!cur.is_showcase)return _web_unauthorized_unauthorized__WEBPACK_IMPORTED_MODULE_8__.Unauthorized.showMoreBox(null,0,_web_unauthorized_unauthorized__WEBPACK_IMPORTED_MODULE_8__.UnauthorizedSourceType.VIDEO,(()=>{showVideo(e,t,_extends({},n,{openInPopup:!1,forceUnauth:!0}),r)})),!1;if(n.forceUnauth=!0,window.mvcur&&mvcur.mvShown&&mvcur.minimized&&mvcur.videoRaw==e)return Videoview.unminimize(),!1;var o=nav.objLoc.claim,i=!(!n.addParams||!/^-?\d+_\d+$/.test(n.addParams.post_id))&&n.addParams.post_id;if(!n.playlistId&&i&&(/^public|groups|profile$/.test(cur.module)&&(0,_dom__WEBPACK_IMPORTED_MODULE_4__.hasClass)("post"+i,"own")?n.playlistId="wall_"+cur.oid:n.playlistId="post_"+n.addParams.post_id),n.playlistId)if(n.addParams=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(n.addParams,{playlist_id:n.playlistId}),window.VideoPlaylist&&VideoPlaylist.getList(n.playlistId))e||(n.addParams.load_playlist=1);else if(/^wall_/.test(n.playlistId)){var a=cur.wallVideos&&cur.wallVideos[n.playlistId];n.addParams.load_playlist=a&&a.list.length>=50?0:1}else n.addParams.load_playlist=!/^(?:post_)?-?\d+_-?\d+$/.test(n.playlistId)||cur.pageVideosList&&cur.pageVideosList[n.playlistId]?0:1;!n.expandPlayer&&cur.videoInlinePlayer&&cur.videoInlinePlayer.getVideoId()==e&&cur.videoInlinePlayer.canExpand()&&(n.expandPlayer=cur.videoInlinePlayer),n.expandPlayer&&(n.addParams=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(n.addParams,{expand_player:1}),delete cur.videoInlinePlayer);var s=new CallHub((function(){n.hidden?n.hidden(s.data,n,t,e):Videoview.showVideo.apply(Videoview,s.data)}),2);stManager.add(["videoview.js","videoview.css","page.js","page.css"],(()=>{s.failed||(n.hidden||(revertLastInlineVideo(),Videoview.show(r,e,t,n)),s.done())})),(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(n,{onDone:function(){var t=Array.prototype.slice.call(arguments);t.unshift(e),s.data=t,s.done()},onFail:function(t){if(s.failed=1,!n.hidden){if(window.mvcur&&mvcur.mvShown)Videoview.hide();else{var r=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.clone)(nav.objLoc);r.z==="video"+e&&delete r.z,r[0]==="video"+e&&(r[0]="videos"+e.split("_")[0]),nav.setLoc(r)}(0,_message_box__WEBPACK_IMPORTED_MODULE_6__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_5__.getLang)("global_error"),t||(0,_lang__WEBPACK_IMPORTED_MODULE_5__.getLang)("global_error_occured")),s.done()}return!0},cache:"status"!==t});var c=n.params;return c||(c={act:"show",video:e,list:t,autoplay:n.autoplay?1:0,ad_video:n.ad_video,module:n.module||window.Videoview&&window.Videoview.getVideoModule()||"",svids:n.svids}),cur.is_showcase&&!c.context&&cur.ref_context&&(c.context=cur.ref_context),n.addParams&&(c=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(c,n.addParams)),(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.trim)(c.module)||(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(c,{_nol:JSON.stringify(nav.objLoc)}),o&&(c.claim=o),ajax.post(`al_video.php?act=${c.act}`,c,n),(0,_web_video_video_utils__WEBPACK_IMPORTED_MODULE_10__.idlizeCall)((()=>{(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.vkImage)().src=`${locProtocol}${rtrgQuery}`})),!1}}function showInlineVideo(videoId,listId,options,ev,thumb){if((0,_dom_events__WEBPACK_IMPORTED_MODULE_2__.checkEvent)(ev))return!0;if(options=options||{},window.mvcur&&mvcur.mvShown||options.hasRestriction)return showVideo(videoId,listId,options,ev);var requestedAt=Date.now();if((0,_dom__WEBPACK_IMPORTED_MODULE_4__.attr)(thumb,"data-loading"))return!1;var h=thumb.clientHeight,w=thumb.clientWidth,btn=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.domByClass)(thumb,"page_post_video_play_inline"),onLoaded=options.onLoaded;onLoaded&&delete options.onLoaded;var params={video:videoId,list:listId,autoplay:options.autoplay,module:options.module};return(0,_dom__WEBPACK_IMPORTED_MODULE_4__.domData)(thumb,"stretch-vertical")&&(params.stretch_vertical=1),(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)(params,options.addParams),showProgress(),loadInlineVideo(params,(function(e,t){hideProgress(),e?onDone.apply(null,t):onFail.apply(null,t)}),options.cache),cur.videoInlinePlayerDestroyerSet||(cur.destroy.push(_destroyInlineVideoPlayer),cur.videoInlinePlayerDestroyerSet=1),(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.vkImage)().src=rtrgQuery,!1;function onDone(title,html,js,opts){revertLastInlineVideo(),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.hide)(thumb);var videoWrap=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("div",{innerHTML:html,className:"inline_video_wrap"},{width:w,height:h});if(-195297477!==opts.mvData.authorId&&(window._videoLastInlined=[videoWrap,thumb]),thumb.parentNode.appendChild(videoWrap),cur.mvOpts=!(!opts||!opts.mvData)&&opts.mvData,opts.player){var container=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.domByClass)(videoWrap,"video_box_wrap");(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.isFunction)(onLoaded)&&(opts.player.params[0].onPlayerLoaded=onLoaded);var linkAttr=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.attr)(thumb,"data-link-attr");linkAttr&&(opts.player.params[0].link_attr=linkAttr),VideoInitializer.initPlayer(container,opts.player.type,opts.player.params,{requestedAt:requestedAt})}try{eval("(function () {"+js+"})();")}catch(e){}if(!params.from_autoplay){var notifier=window.Notifier;notifier&&setTimeout((()=>notifier.lcSend("video_start")),0);var audioPlayer=window.ap;audioPlayer&&audioPlayer.isPlaying()&&(audioPlayer.pause(),audioPlayer.pausedByVideo=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.vkNow)())}ev&&domClosest("bookmarks_row_type_video",ev.target)&&statlogsValueEvent("bookmarks_product_analytics",{item_type:"video",item_owner_id:cur.mvOpts.oid,item_id:cur.mvOpts.vid,time:window.getServerTime()}),thumb.setAttribute("data-playing",1)}function onFail(e){params.from_autoplay||(0,_message_box__WEBPACK_IMPORTED_MODULE_6__.showFastBox)((0,_lang__WEBPACK_IMPORTED_MODULE_5__.getLang)("global_error"),e||(0,_lang__WEBPACK_IMPORTED_MODULE_5__.getLang)("global_error_occured"))}function showProgress(){thumb.setAttribute("data-loading",1),options.no_progress||((0,_dom__WEBPACK_IMPORTED_MODULE_4__.addClass)(btn,"page_post_video_play_inline_loading"),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.val)(btn,(0,_layout_utils__WEBPACK_IMPORTED_MODULE_7__.getProgressHtml)()))}function hideProgress(){thumb.removeAttribute("data-loading"),options.no_progress||((0,_dom__WEBPACK_IMPORTED_MODULE_4__.removeClass)(btn,"page_post_video_play_inline_loading"),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.val)(btn,""))}}function loadInlineVideo(e,t,n){var r=(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.extend)({autoplay:0,module:cur.module},e);(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.trim)(r.module)||(r._nol=JSON.stringify(nav.objLoc));var o=["videoview.js","videoview.css"];function i(e,n){(0,_utils_common__WEBPACK_IMPORTED_MODULE_3__.isFunction)(t)&&t(e,n)}r.from_autoplay&&o.push("videoplayer.css"),ajax.post("al_video.php?act=show_inline",r,{onDone:function(){var e=[].slice.call(arguments);i(!0,e)},onFail:function(){var e=[].slice.call(arguments);return i(!1,e),!0},stat:o,local:1,cache:n})}function revertLastInlineVideo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(window._videoLastInlined){var n,r=!1,o=(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ge)(e);if(o&&(n=window._videoLastInlined[0])){for(;n=n.parentNode;)if(n==o){r=!0;break}if(!r)return}(0,_dom__WEBPACK_IMPORTED_MODULE_4__.re)(window._videoLastInlined[0]),(0,_dom__WEBPACK_IMPORTED_MODULE_4__.show)(window._videoLastInlined[1]),window._videoLastInlined[1].removeAttribute("data-playing"),window._videoLastInlined=!1,_destroyInlineVideoPlayer(t),delete cur.mvOpts}}function _destroyInlineVideoPlayer(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];cur.videoInlinePlayer&&(cur.videoInlinePlayer.destroy(e),delete cur.videoInlinePlayer)}function pauseLastInlineVideo(){if(window._videoLastInlined){var e=cur.videoInlinePlayer||(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ge)("video_yt")&&window.VideoYoutube;if(e){if(e.isActiveLive&&e.isActiveLive())return;cur.mvOpts.lastPlayerState=e.getState(),e.togglePlay(!1)}}}function playLastInlineVideo(){if(window._videoLastInlined&&cur.mvOpts&&cur.mvOpts.lastPlayerState===_videoplayer_lib_player_states__WEBPACK_IMPORTED_MODULE_11__.PLAYING){var e=cur.videoInlinePlayer||(0,_dom__WEBPACK_IMPORTED_MODULE_4__.ge)("video_yt")&&window.VideoYoutube;e&&e.togglePlay(!0)}}function checkMp4(e){e(!0)}var VideoConstants={VIDEO_ITEM_INDEX_OWNER_ID:0,VIDEO_ITEM_INDEX_ID:1,VIDEO_ITEM_INDEX_THUMB:2,VIDEO_ITEM_INDEX_TITLE:3,VIDEO_ITEM_INDEX_FLAGS:4,VIDEO_ITEM_INDEX_DURATION:5,VIDEO_ITEM_INDEX_HASH:6,VIDEO_ITEM_INDEX_MODER_ACTS:7,VIDEO_ITEM_INDEX_OWNER:8,VIDEO_ITEM_INDEX_DATE:9,VIDEO_ITEM_INDEX_VIEWS:10,VIDEO_ITEM_INDEX_PLATFORM:11,VIDEO_ITEM_INDEX_BLOCKED:12,VIDEO_ITEM_INDEX_MUSIC_VIDEO_META:13,VIDEO_ITEM_INDEX_ARIA:14,VIDEO_ITEM_INDEX_RESTRICTION_BLOCK:15,VIDEO_ITEM_INDEX_RESTRICTION_CLASSES:16,VIDEO_ITEM_INDEX_ADMIN_INFO:17,VIDEO_ITEM_INDEX_CARD_MENU_TOGGLE:18,VIDEO_ITEM_INDEX_RAW_DURATION:19,VIDEO_ITEM_INDEX_LINK:20,VIDEO_ITEM_INDEX_TRAILER:21,VIDEO_ITEM_INDEX_VIEWED_DURATION:22,VIDEO_ITEM_INDEX_VIEWED_DAY:23,VIDEO_ITEM_INDEX_LIST_ID:24,VIDEO_ITEM_INDEX_PLAYLIST_ID:25,VIDEO_ITEM_INDEX_CARD_ACTIONS:26,VIDEO_ITEM_INDEX_CARD_PRIVACY_ICONS:27,VIDEO_ITEM_INDEX_DESCRIPTION:28,VIDEO_ITEM_INDEX_OWNER_PHOTO:29,VIDEO_ITEM_INDEX_SMALL_THUMB:30,VIDEO_ITEM_INDEX_ML_THUMB_ID:31,VIDEO_ITEM_FLAG_EXTERNAL:1,VIDEO_ITEM_FLAG_ACTIVE_LIVE:2,VIDEO_ITEM_FLAG_CAN_EDIT:64,VIDEO_ITEM_FLAG_CAN_DELETE:128,VIDEO_ITEM_FLAG_CAN_ADD:256,VIDEO_ITEM_FLAG_PRIVATE:512,VIDEO_ITEM_FLAG_NO_AUTOPLAY:1024,VIDEO_ITEM_FLAG_ADDED:2048,VIDEO_ITEM_FLAG_SKIP_THUMB_LOAD:4096,VIDEO_ITEM_FLAG_NEED_SIGN_IN:8192,VIDEO_ITEM_FLAG_HD:16384,VIDEO_ITEM_FLAG_DELETED:32768,VIDEO_ITEM_FLAG_CAN_MOVE:65536,VIDEO_ITEM_FLAG_CAN_DELETE_FROM_HISTORY:1<<17,VIDEO_ITEM_FLAG_PRIVATE_BY_LINK:1<<18,VIDEO_ITEM_FLAG_LIVE:1<<19,VIDEO_ITEM_FLAG_PRIVATE_NOT_PUBLISHED:1<<20,VIDEO_ITEM_FLAG_PRIVATE_MEMBERS:1<<21};function initVideo(){window._videoLastInlined=!1}},18793:(e,t,n)=>{"use strict";n.d(t,{Scroll:()=>c});n(95767),n(91181),n(96253);var r=n(67294),o=n(32821),i=n(80309),a=n(45697);function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=e=>{var t=e.children,n=s(e,["children"]);return r.createElement(o.ScrollContext.Provider,{value:{createScroll:i.createScroll}},r.createElement(o.Scroll,n,t))};c.propTypes={className:a.string,children:a.oneOfType([a.element,a.string]).isRequired,isNative:a.bool,isShadows:a.bool,neverHide:a.bool,onScroll:a.func},c.defaultProps={isNative:!1,isShadows:!1,neverHide:!1,onScroll:null}},42041:(e,t,n)=>{"use strict";n.d(t,{Likes:()=>E});n(91181),n(96253),n(96409),n(59357),n(75115),n(21466);var r=n(15544),o=n(49535),i=n(76852),a=n(95724),s=n(35676),c=n(50167),l=n(40906),u=n(54612),d=n(86067),_=n(65864),p=n(25698),h=n(95146),f=n(8706),m=n(7337),g=n(76772),v=n(10277);function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}var E={toggle(e,t,n,i){if((0,o.cancelEvent)(t),(0,l.isObject)(window.cur)&&(0,l.isFunction)(cur.viewAsBox))return cur.viewAsBox();if(vk.widget&&!vk.id)return window.Widgets.oauth();var a=(0,r.hasClass)(e,"active");(0,r.addClass)(e,"animate"),this.clientUpdate(n,p.LikeButtonTypes.like,a?-1:1,!a);var s=()=>{(0,r.toggleClass)(e,"active",a),this.clientUpdate(n,p.LikeButtonTypes.like,a?1:-1,a)};window.ajax.post("like.php",{act:a?"a_do_unlike":"a_do_like",object:n,hash:i,list:cur.pvListId,wall:2,from:this._getReference(n),from_widget:vk.widget?1:0},{onDone:t=>{if(t.unauth_action_box)return s(),void g.UnauthActionBox.show(t.unauth_action_box);this.update(n,t);var r=n.match(/^(wall|market)(.*)/);r&&cur.onLike&&cur.onLike(e,r[1],r[2],a)},onFail:()=>(s(),!1)}),(0,l.intval)((0,r.domData)(e,"count"))>0?E.showLikes(e,n,{fast:!0}):e.tt&&e.tt.destroy&&e.tt.destroy()},_getReference:e=>cur.pvShown?"photo_viewer":e===cur.wallLayer?"wkview":window.mvcur&&window.mvcur.mvShown?"videoview":cur.wallType?"feed"===cur.wallType?"news"===cur.section?`feed_${cur.subsection?cur.subsection:cur.section}`:"recommended"===cur.section?"feed_recommended"+("recent"!==cur.subsection?"_"+cur.subsection:""):(0,a.inArray)(cur.section,["friends","groups","videos","photos"])?"feed_"+(cur.subsection?"_"+cur.subsection:""):`feed_${cur.section}`:"top"===cur.wallType?"wall_top":"wall_"+(cur.onepost?"one":(cur.wallType||"").indexOf("full_")?"page":"full"):cur.module,share(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(vk.widget&&!vk.id)return window.Widgets.oauth();if((0,l.isObject)(window.cur)&&(0,l.isFunction)(cur.viewAsBox))return cur.viewAsBox();var n=(0,_.parseLikeObjectId)(e),r=n.objectType,o=n.objectId;(vk.widget?window.showBox:u.showBox)("like.php",y({act:"publish_box",object:e,from_widget:vk.widget?1:0},t),{onDone:(e,t)=>{t.unauth_action_box&&(e.hide(),g.UnauthActionBox.show(t.unauth_action_box))},stat:["page.js","page.css","wide_dd.js","wide_dd.css",window.jsc("web/sharebox.js")]}),"wall"===r&&window.Wall&&window.Wall.triggerAdPostStat(o,"share_post"),cur.RpcMethods&&(cur.RpcMethods.likeFullUpdate=t=>E.update(e,window.cleanObj(t)))},clientUpdate(e,t,n,o){var i=this._getButtonsByType(e,t);if(i.length){var a=(0,l.intval)((0,r.domData)(i[0],"count"))+n;this._updateDom(e,t,a,o),this.updateExternalIndex(e,{type:t,count:a,isActive:o})}},update(e,t){if(!isNaN(parseInt(t.like_num))){var n=(0,l.isUndefined)(t.like_my)?void 0:!!(0,l.intval)(t.like_my);this._updateDom(e,p.LikeButtonTypes.like,t.like_num,n,t.like_title),this.updateExternalIndex(e,{type:p.LikeButtonTypes.like,count:t.like_num,isActive:n})}if(!isNaN(parseInt(t.share_num))){var r=(0,l.isUndefined)(t.share_my)?void 0:!!(0,l.intval)(t.share_my);this._updateDom(e,p.LikeButtonTypes.share,t.share_num,r,t.share_title),this.updateExternalIndex(e,{type:p.LikeButtonTypes.share,count:t.share_num})}if((0,a.isNumeric)(t.views_num)&&this._updateDom(e,p.LikeButtonTypes.views,t.views_num,void 0,t.views_title),(0,a.isNumeric)(t.comment_num)&&this._updateDom(e,p.LikeButtonTypes.comment,t.comment_num),t[h.REACTIONS_COUNTS_RESPONSE_FIELD]){var o=!!t.isQueueUpdate;(0,m.triggerReactionsUpdate)(e,t[h.REACTIONS_COUNTS_RESPONSE_FIELD],void 0,{isQueueUpdate:o,isUserAction:!1,previewVisibility:f.previewVisibilityUseCurrent})}},updateComments(e,t){this.update(e,{comment_num:t})},_updateDom(e,t,n,o,i){var c=this._getButtonsByType(e,t),u=t===p.LikeButtonTypes.views;if(null==c?void 0:c.length){var h="";u?h=n:n>0&&(h=vk.widget?(0,a.formatCount)(n):(0,d.langNumeric)(n,"%s",!0)),u||(n=(0,l.intval)(n));for(var f=0;f<c.length;f++){var m=c[f];if(!(0,r.hasClass)(m,"no_counter")){var g,y,E=u?c[f]:(0,_.getElementLikeButtonCount)(c[f]);if((0,s.animateCount)(E,h,{str:"auto",noWrapWidth:!u,noSpaceIfEmpty:!0}),(0,r.toggleClass)(m,"empty",n<=0),"boolean"==typeof o&&(0,r.toggleClass)(m,"active",o),(0,r.attr)(c[f],"data-count",n),(0,v.updateAriaLabelCounter)(m,n,t),u)null==m||null===(g=m.closest)||void 0===g||null===(y=g.call(m,".like_views"))||void 0===y||y.setAttribute("title",i||"");var w=c[f].tt;if(w){var b=(0,r.domByClass)(w.container,"_content"),C=(0,r.domByClass)(w.container,"_value"),S=(0,r.domByClass)(w.container,"_title"),T=(0,l.intval)((0,r.val)(C));(0,r.val)(C,n),i&&(0,r.val)(S,i),(0,l.isObject)(w)&&(w.likeInvalidated=!0),(T!==n&&T<7||!1===i)&&(t===p.LikeButtonTypes.like?m.needReinitLikesTT=!0:t===p.LikeButtonTypes.share&&(m.needReinitShareTT=!0)),t===p.LikeButtonTypes.like&&(0,r.toggleClass)(b,"me_hidden",!o),!1===i&&w.destroy&&w.destroy()}}}}},_getButtonsByType:(e,t)=>(0,r.domQuery)(`._like_${e} ._${t}, ._like_${e} [data-like-button-type="${t}"]`),showLikes(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e instanceof HTMLElement&&!e.postDontShowLikes&&(!vk.widget||!vk.show_external_auth_box)){var o=n.views?{views:1}:n.share?{published:1}:{};n.listId&&(o.list=n.listId),n.like_stats_params&&Object.assign(o,n.like_stats_params);var s=!!(0,r.geByClass1)("share",(0,r.gpeByClass)("like_wrap",e)),c=document.body,u=!1,d=getComputedStyle(e),p=(0,l.intval)(d.getPropertyValue("padding-left").replace("px","")),h=(0,l.intval)(d.getPropertyValue("padding-top").replace("px","")),f=(0,_.getElementLikeButtonIcon)(e),m=40;"wpost"===n.from&&(m=24);var g,v,y=[m-(0,r.getSize)(f)[0]/2-p,10-h],w=n.cl||"";if(n.share)w+="likes_tt_share";else if(w+="likes_tt_like","widget_community"===n.from)y[0]=6;else if("wcomments"===n.from||"widget_comments"===cur.wallType){y[0]=(0,r.getSize)(e)[0]+16-(0,r.getSize)(f)[0]/2-10}else"photo_carousel"===n.from&&(y[1]=10);if(!!(null==n?void 0:n.isFromReactionsPreview)){var b=e.querySelector("._ReactionsPreview__itemsContainer");if(b){var C=b.querySelector(".ReactionsPreviewItem"),S=getXYRect(C,!1),T=(S.width||0)/2,D=T;c=b,S.left+S.width/2>window.innerWidth/2&&(u=!0,D=b.offsetWidth-T),y[0]=-D+m}}n.share?(g="needReinitLikesTT",v="resetLikesTTTimer"):(g="needReinitShareTT",v="resetShareTTTimer"),clearTimeout(e[v]),(0,i.showTooltip)(e,{url:"/like.php",params:(0,a.extend)({act:"a_get_stats",object:t,has_share:s?1:""},o),appendEl:c,slide:15,shift:y,ajaxdt:n.fast?0:100,showdt:n.fast?0:400,hidedt:200,dir:"auto",checkLeft:!0,needLeft:u,reverseOffset:80,noZIndex:!0,hasover:!0,tip:{over:()=>{E.showLikes(e,t,n)}},typeClass:"like_tt",className:w,onHide:()=>{clearTimeout(e[v]),e[g]&&(e[v]=setTimeout((()=>{delete e[g],e.tt&&e.tt.destroy&&e.tt.destroy()}),200))}})}},showShare:function(e,t,n){E.showLikes(e,t,(0,a.extend)(n,{share:1}))},updateViews:(e,t)=>{vk.widget&&vk.show_external_auth_box||window.ajax.post("like.php",{act:"a_get_stats",object:e,views:1},{cache:1,onDone(t,n){var o=(0,r.ce)("div",{innerHTML:n});E._updateDom(e,p.LikeButtonTypes.views,t,void 0,o.innerText||o.textContent)}})},makeTemplate(e,t){if(!e)return"";(t=(0,a.extend)({buttons_prepend:"",object_raw:"",likes_count:"",liked:!1,share_count:"",shared:"",views_count:"",share_opts:{},like_opts:{},class_name:"",like_cont_class:"",like_class_name:"",[h.REACTIONS_COUNTS_RESPONSE_FIELD]:"",reactions_class_name:""},t)).like_active=t.liked?"active":"",t.share_active=t.shared?"active":"",t.comment_active="",t.likes_formatted_count=t.likes_count>0?(0,d.langNumeric)(t.likes_count,"%s",!0):"",t.share_formatted_count=t.share_count>0?(0,d.langNumeric)(t.share_count,"%s",!0):"",t.share_opts=this._convertOptsToString(t.share_opts),t.like_opts=this._convertOptsToString(t.like_opts),t.like_class_name+=t.likes_count>0?"":" empty",t.share_class_name=t.share_count>0?"":"empty";var n=t[h.REACTIONS_COUNTS_RESPONSE_FIELD],o=!!n&&Object.values(n).some((e=>!!e));return t.reactions_class_name+=o?"":" PostBottomAction--empty",(0,r.rs)(e,t)},_convertOptsToString:e=>JSON.stringify(e).replace(/\"/g,"'"),updateExternalIndex(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,_.parseLikeObjectId)(e),r=n.objectType,o=n.objectId;switch(r){case"photo":if(!cur.pvShown||!cur.pvCurPhoto||cur.pvCurPhoto.id!==o)return;var i=cur.pvListId,a=cur.pvIndex,s=cur.pvData[i][a];t.type===p.LikeButtonTypes.like?(s.likes=t.count,s.liked=t.isActive,cur.pvCommsLikes[s.id][1]=t.count):t.type===p.LikeButtonTypes.share&&(s.shares=t.count);break;case"video":if(window.mvcur&&window.mvcur.mvShown&&window.mvcur.videoRaw===o&&t.type===p.LikeButtonTypes.like){var c=window.Videoview.getMvData();c.likes=t.count,void 0!==t.isActive&&(c.liked=t.isActive,window.Videoview.playerOnLiked(t.isActive),window.Videoview.recache())}}},showLikesList(e,t){cur.viewAsBox||(0,r.hasClass)((0,r.gpeByClass)("like_btn",e),"no_counter")||(0,c.showWiki)({w:"likes/"+(0,a.clean)(t)},!1,!1,{queue:1})},showSharesList(e,t){cur.viewAsBox||(0,r.hasClass)((0,r.gpeByClass)("like_btn",e),"no_counter")||(0,c.showWiki)({w:"shares/"+(0,a.clean)(t)},!1,!1,{queue:1})}}},99284:(e,t,n)=>{"use strict";n.d(t,{default:()=>g});n(83946),n(21466),n(59357),n(75115);var r=n(67294),o=n(45697),i=n(86409),a=n(41650),s=n(81117),c=n(18690),l=n(89366),u=n(36680),d=n(26555),_=n(78486),p=n(39664),h=n(3797),f=n(33024),m=n(82452);class g extends r.Component{constructor(e){var t;super(e),t=this,this.componentDidMount=()=>{document.addEventListener("keydown",this.onDocumentKeyDown),this.setInitialState(),this.synchronizeStateWithBackend()},this.componentWillUnmount=()=>{document.removeEventListener("keydown",this.onDocumentKeyDown),this.removeResendCodeButtonTimer()},this.componentDidUpdate=(e,t)=>{this.state.initialLoading||this.state.delayedUnblockExplanation||this.state.delayedUnblockFinished||t.phone===this.state.phone&&t.code===this.state.code&&t.codeSent===this.state.codeSent||this.updateFocus()},this.sendCode=()=>{if(!this.isBusy()){this.resetMessage();var e={act:g.acts.sendCode,phone:this.getPhonePrefix()+this.state.newPhone,hash:this.state.processHash,sure:1};ajax.post(g.controller,e,{onDone:e=>{this.setStateByProcess(e),this.setResendCodeButtonTimer()},onFail:e=>(this.setErrorMessage(e),!0),showProgress:()=>this.setState({mainButtonLoading:!0}),hideProgress:()=>this.setState({mainButtonLoading:!1})})}},this.sendCodeToBoundPhone=()=>{if(!this.isBusy()){this.resetMessage();var e={act:g.acts.sendCodeToBoundPhone,hash:this.state.processHash};ajax.post(g.controller,e,{onDone:e=>{this.setStateByProcess(e),this.setResendCodeButtonTimer()},onFail:e=>(this.setErrorMessage(e),this.synchronizeStateWithBackend(),!0),showProgress:()=>this.setState({mainButtonLoading:!0}),hideProgress:()=>this.setState({mainButtonLoading:!1})})}},this.resetPhone=e=>{this.isBusy()||(this.removeResendCodeButtonTimer(),e&&this.resetMessage(),this.setState({phonePrefixIndex:g.constants.firstCountryIndex,backendCallResetsEnabled:null,phone:"",code:"",newPhone:"",newCode:"",phonePrefixInputNeeded:!0,codeSent:!1,checkCodeAttemptsAmount:void 0}))},this.resetUnblockForm=()=>{if(!this.isBusy()){var e={act:g.acts.resetUnblockForm,hash:this.state.processHash};ajax.post(g.controller,e,{onDone:e=>{this.setStateByProcess(e,{delayedUnblockExplanation:"",delayedUnblockFinished:!1})},onFail:e=>(this.setErrorMessage(e),this.synchronizeStateWithBackend(),!0),showProgress:()=>this.setState({resetUnblockDataButtonLoading:!0}),hideProgress:()=>this.setState({resetUnblockDataButtonLoading:!1})})}},this.checkCode=()=>{if(!this.isBusy())if(this.state.newCode.length<4)(0,i.notaBene)(this.references.validationCodeInput.element);else{this.resetMessage();var e={act:g.acts.checkCode,code:this.state.newCode,hash:this.state.processHash};ajax.post(g.controller,e,{onDone:e=>{this.setStateByProcess(e),this.references.passwordInput.element.focus(),this.setState({mainButtonLoading:!1})},onFail:e=>(this.synchronizeStateWithBackend((()=>{this.setErrorMessage(e),this.setState({mainButtonLoading:!1})})),!0),showProgress:()=>this.setState({mainButtonLoading:!0})})}},this.resendCode=()=>{if(!this.isBusy()){this.resetMessage();var e={act:g.acts.resendCode,hash:this.state.processHash};ajax.post(g.controller,e,{onDone:e=>{this.setStateByProcess(e,{newCode:""}),this.setInfoMessage(this.getResentInfoMessageText()),this.setResendCodeButtonTimer(),this.references.validationCodeInput.element.focus()},onFail:e=>(this.setErrorMessage(e),this.synchronizeStateWithBackend(),!0),showProgress:()=>this.setState({noCodeButtonLoading:!0}),hideProgress:()=>this.setState({noCodeButtonLoading:!1})})}},this.unblock=()=>{if(!this.isBusy())if(g.isBadPassword(this.state.newPassword))(0,i.notaBene)(this.references.passwordInput.element);else{this.resetMessage();var e={act:g.acts.unblock,pass:this.state.newPassword,hash:this.state.unblockHash};ajax.post(g.controller,e,{onDone:e=>{e.delayed_unblock_explanation?this.setState({delayedUnblockExplanation:e.delayed_unblock_explanation,mainButtonLoading:!1}):(this.setState({password:this.state.newPassword}),g.refreshAuthDataAndRedirectToFeed(e.lg_domain_h,e.logout_hash,e.email,this.state.newPassword))},onFail:e=>(this.setErrorMessage(e),this.setState({mainButtonLoading:!1}),this.synchronizeStateWithBackend(),!0),showProgress:()=>this.setState({mainButtonLoading:!0})})}},this.redirectToAuth=()=>{this.setState({redirectToAuthButtonLoading:!0}),window.location.href=document.getElementById("top_logout_link").href},this.synchronizeStateWithBackend=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.constants.statusSyncRetriesCount,r={act:g.acts.getStatus};ajax.post(g.controller,r,{onDone:n=>{e(),t.setStateByProcess(n)},onFail:r=>(t.setErrorMessage(r),n>0?(setTimeout((()=>{t.synchronizeStateWithBackend(e,--n)}),g.constants.statusSyncRetriesTimeoutMicroseconds),!0):((0,s.destroyComponentInBox)(),(0,m.showErrorBox)(a.default.getLang("login_unban_fetch_ban_data_internal_error")),!0))})},this.setStateByProcess=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.getStateByProcess(e);t.state.initialLoading&&(r.initialLoading=!1),n&&Object.assign(r,n),0!==t.state.unbanDataId&&void 0!==t.state.unbanDataId&&r.unbanDataId!==t.state.unbanDataId&&t.setErrorMessage(a.default.getLang("login_unban_data_expired")),t.setState(r),r.delayedUnblockExplanation||r.delayedUnblockFinished||(r.codeSent&&r.resendButtonSecondsLeft&&t.setResendCodeButtonTimer(),0===r.checkCodeAttemptsAmount&&t.resetPhone(!1))},this.getStateByProcess=e=>({phone:e.phone,code:e.code,password:e.password,phonePrefixInputNeeded:!e.phone,canEditPhone:e.can_edit_phone,codeSent:e.code_sent,checkCodeAttemptsAmount:Number(e.check_code_attempts_amount),backendCallResetsEnabled:e.call_resets_enabled,phonePrefixesCallResetsEnabledConfig:e.phone_prefixes_call_resets_enabled_config,phonePrefixesToCountryMapping:e.country_to_phone_prefixes_map,unbanDataId:e.unban_data_id,delayedUnblockExplanation:e.delayed_unblock_explanation,delayedUnblockFinished:e.delayed_unblock_finished,resendCodeTimer:g.constants.noResetCodeTimerEnabled,resendButtonSecondsLeft:e.sms_resend_delay_timer_left,resendAttemptsAmount:e.resend_attempts_amount,resendCodeDelay:e.sms_resend_delay,phonePrefixIndex:this.getInitialPhonePrefixIndex(e.country_to_phone_prefixes_map,e.phone_prefix),newPhone:e.phone,newCode:e.code,newPassword:"",processHash:e.process_hash,unblockHash:e.unblock_hash}),this.areCallResetsEnabled=()=>{if(null!==this.state.backendCallResetsEnabled)return this.state.backendCallResetsEnabled;var e=String(this.state.phonePrefixesToCountryMapping[this.state.phonePrefixIndex][0]),t=Number(e.replace("_",""));return!this.state.phonePrefixesCallResetsEnabledConfig.includes(t)},this.updateFocus=()=>{this.state.phone?this.state.phone&&!this.state.code&&this.state.codeSent?this.references.validationCodeInput.element.focus():this.state.phone&&this.state.code&&this.references.passwordInput.element.focus():this.references.phoneInput.element.focus()},this.setErrorMessage=e=>{"string"==typeof e&&this.setState({message:e,isError:!0})},this.setInfoMessage=e=>{this.setState({message:e,isError:!1})},this.resetMessage=()=>{this.setState({message:""})},this.isBusy=()=>this.state.mainButtonLoading||this.state.noCodeButtonLoading||this.state.resetUnblockDataButtonLoading,this.onDocumentKeyDown=e=>{e.keyCode===KEY.ENTER&&(this.references.mainButton.props.onClick(),e.stopPropagation(),e.preventDefault())},this.setResendCodeButtonTimer=()=>{if(this.state.resendCodeTimer===g.constants.noResetCodeTimerEnabled){var e=this.state.resendButtonSecondsLeft||this.state.resendCodeDelay;this.setState({resendCodeTimer:setInterval(this.resendCodeButtonTimerTick,u.SECOND),resendButtonSecondsLeft:e})}},this.resendCodeButtonTimerTick=()=>{var e=this.state.resendButtonSecondsLeft-1;this.setState({resendButtonSecondsLeft:e}),0===e&&this.removeResendCodeButtonTimer()},this.removeResendCodeButtonTimer=()=>{clearInterval(this.state.resendCodeTimer),this.setState({resendCodeTimer:g.constants.noResetCodeTimerEnabled,resendButtonSecondsLeft:0})},this.noResendsWereMade=()=>this.state.resendAttemptsAmount===g.constants.noCodeResentAmount,this.isLastResendStep=()=>this.state.resendAttemptsAmount===g.constants.maxCodeResentAmount,this.shouldRenderCallResetsSteps=()=>this.areCallResetsEnabled()?this.noResendsWereMade():this.isLastResendStep(),this.getCodeBlockHeaderLabel=()=>this.shouldRenderCallResetsSteps()?a.default.getLang("login_authcheck_called_phone_label"):a.default.getLang("login_confirmation_code"),this.getCodeBlockTooltipLabel=()=>this.shouldRenderCallResetsSteps()?this.props.tooltips.codeCallReset:this.props.tooltips.code,this.getResentInfoMessageText=()=>this.shouldRenderCallResetsSteps()?a.default.getLang("login_authcheck_call_reset_sent"):a.default.getLang("login_authcheck_sms_resent"),this.getResendCodeWaitingLabel=()=>{var e;e=this.areCallResetsEnabled()?this.noResendsWereMade()?a.default.getLang("join_send_code_via_sms_time"):a.default.getLang("join_resend_code_time"):this.noResendsWereMade()?a.default.getLang("join_resend_code_time"):a.default.getLang("login_authcheck_send_call_reset_delay");var t=Math.floor(this.state.resendButtonSecondsLeft/60)+":"+(this.state.resendButtonSecondsLeft%60<10?"0":"")+this.state.resendButtonSecondsLeft%60;return e.replace("%s",t)},this.getResendCodeButtonLabel=()=>this.areCallResetsEnabled()?this.noResendsWereMade()?a.default.getLang("join_send_code_via_sms"):a.default.getLang("join_no_code"):this.noResendsWereMade()?a.default.getLang("join_no_code"):a.default.getLang("login_authcheck_send_call_reset_message"),this.getInitialPhonePrefixIndex=(e,t)=>{var n=e.findIndex((e=>e[3]==t));return-1===n&&(n=g.constants.firstCountryIndex),n},this.mapPhonePrefixesToOption=()=>this.state.phonePrefixesToCountryMapping.map(((e,t)=>({constant:t,name:e[1]}))),this.getPhonePrefix=()=>this.state.phonePrefixesToCountryMapping[this.state.phonePrefixIndex][3],this.renderResendCodeButton=()=>{var e;if(this.state.resendAttemptsAmount===g.constants.maxCodeResentAmount)e=r.createElement("div",{className:"resend_button resend_button--waiting"},a.default.getLang("reg_code_limit_exceeded"));else if(0===this.state.resendButtonSecondsLeft)e=r.createElement(c.default,{appearance:"link",loading:this.state.noCodeButtonLoading,className:"resend_button",onClick:this.resendCode},this.getResendCodeButtonLabel());else{var t=this.getResendCodeWaitingLabel();e=r.createElement("div",{className:"resend_button resend_button--waiting"},t)}return r.createElement("div",{className:"resend_button_wrap"},e)},this.renderPhonePrefixBlock=()=>{if(!this.state.phonePrefixInputNeeded)return"";var e=this.state.phone?g.constants.finishedClass:"";return r.createElement("div",{className:`input phone_number_prefix_input ${e}`},r.createElement("div",{className:"label"},a.default.getLang("join_country_label")),r.createElement(d.default,{className:`dark phone_number_prefix _phone_input_tooltip ${e}`,config:{id:"phone_number_prefix",placeholder:"",selected:[this.state.phonePrefixIndex],options:this.mapPhonePrefixesToOption()},singleSelectCrutch:!0,onFilterChange:(e,t)=>{this.setState({phonePrefixIndex:null===t?this.state.phonePrefixIndex:t})},readOnly:!!this.state.phone}))},this.renderPhoneBlock=()=>{var e=this.state.phone&&!this.state.code&&this.state.canEditPhone?r.createElement("a",{className:"_change_phone_button",onClick:()=>this.resetPhone(!0)},a.default.getLang("login_unblock_form_change_phone")):"",t=this.state.phonePrefixInputNeeded?this.getPhonePrefix():"",n=this.state.phone?g.constants.finishedClass:"",o=!this.state.phone&&!this.state.code&&this.state.phonePrefixInputNeeded,i=this.state.newPhone;return r.createElement("div",{className:"input phone_number_input"},r.createElement("div",{className:"label"},a.default.getLang("login_mobile_phone")),e,r.createElement(_.default,{text:this.getPhoneBlockTooltipLabel(),appearance:g.constants.tooltipAppearance,position:g.constants.tooltipPosition,width:g.constants.tooltipWidth,marginLeft:g.constants.tooltipMarginLeft,isShown:o},r.createElement("div",{id:"join_phone_prefixed",className:`prefix_input_wrap ${n}`},r.createElement("div",{id:"join_phone_prefix",className:"prefix_input_prefix"},r.createElement("nobr",null,t)),r.createElement("div",{className:"prefix_input_field"},r.createElement(l.default,{className:`prefix_input phone_number _phone_input_tooltip ${n}`,value:i,readOnly:!!this.state.phone,onChange:e=>this.setState({newPhone:e.target.value}),ref:e=>{this.references.phoneInput=e}}),r.createElement("div",{className:"prefix_input_border"})))))},this.renderCodeBlock=()=>{if(!this.state.phone)return"";if(!this.state.codeSent)return"";var e=this.getCodeBlockHeaderLabel(),t=this.state.code?g.constants.finishedClass:"",n=this.state.phone&&!this.state.code,o=!!this.state.code;return r.createElement("div",{className:"input verification_code_input"},r.createElement("div",{className:"label"},e),r.createElement(_.default,{text:this.getCodeBlockTooltipLabel(),appearance:g.constants.tooltipAppearance,position:g.constants.tooltipPosition,width:g.constants.tooltipWidth,marginLeft:g.constants.tooltipMarginLeft,isShown:n},r.createElement(l.default,{className:`verification_code _verification_code_input_tooltip dark ${t}`,ref:e=>{this.references.validationCodeInput=e},placeholder:a.default.getLang("login_authcheck_enter_code"),value:this.state.newCode,readOnly:o,onChange:e=>this.setState({newCode:e.target.value})})))},this.renderPasswordBlock=()=>{if(!this.state.phone||!this.state.code)return"";var e=g.checkPasswordStrength(this.state.newPassword),t=this.state.newPassword?r.createElement("div",{id:"blocked_about_pass",className:"blocked_pwd_level"+e}):"",n=this.state.newPassword?r.createElement("div",{className:"blocked_pass_strength blocked_about_login"},a.default.getLang(`join_pwd_level${e}`)):"",o=!this.state.password;return r.createElement("div",{className:"input new_password_input"},r.createElement("div",{className:"label"},a.default.getLang("login_new_password_label")),r.createElement(_.default,{text:this.props.tooltips.password,appearance:g.constants.tooltipAppearance,position:g.constants.tooltipPosition,width:g.constants.tooltipWidth,marginLeft:g.constants.tooltipMarginLeft,isShown:o},r.createElement(l.default,{className:"dark new_password _password_input_tooltip",ref:e=>{this.references.passwordInput=e},placeholder:a.default.getLang("login_enter_password"),value:this.state.newPassword,onChange:e=>this.setState({newPassword:e.target.value})})),t,n)},this.renderMainButton=()=>{var e,t,n,o=this.areCallResetsEnabled()?a.default.getLang("reg_validate_call_reset_button"):a.default.getLang("login_receive_code");if(this.state.phone||this.state.code)if(this.state.phone&&!this.state.code)this.state.codeSent?(e=this.checkCode,t=a.default.getLang("login_check_code"),n=this.renderResendCodeButton()):(e=this.sendCodeToBoundPhone,t=o,n="");else{if(!this.state.phone||!this.state.code)return"";e=this.unblock,t=a.default.getLang("login_blocked_unblock_page"),n=""}else e=this.sendCode,t=o,n="";return r.createElement("div",null,r.createElement(c.default,{className:"UnblockForm__mainButton",loading:this.state.mainButtonLoading,onClick:e,ref:e=>{this.references.mainButton=e}},t),n)},this.renderMessage=()=>{if(!this.state.message)return"";var e=this.state.isError?"error":"";return r.createElement("div",{id:"unblock_box_errors_block"},r.createElement("div",{className:"msg submit_error "+e,dangerouslySetInnerHTML:{__html:this.state.message}}))},this.renderContent=()=>this.state.initialLoading?g.renderInitialLoading():this.state.delayedUnblockExplanation?this.renderDelayedWaitExplanation():this.state.delayedUnblockFinished?this.renderDelayedUnblockFinishedScreen():r.createElement("div",{className:"UnblockForm__content__inputs"},this.renderPhonePrefixBlock(),this.renderPhoneBlock(),this.renderCodeBlock(),this.renderPasswordBlock(),this.renderMainButton()),this.renderDelayedWaitExplanation=()=>r.createElement("div",{className:"DelayedWaitExplanation"},r.createElement("div",{className:"DelayedWaitExplanation__message msg submit_error ",dangerouslySetInnerHTML:{__html:a.default.getLang("restore_change_phone_done_wait_banned").replace("{date}",this.state.delayedUnblockExplanation)}}),r.createElement("div",{className:"DelayedWaitExplanation__progressWrap"},r.createElement(c.default,{appearance:"tertiary",loading:this.state.resetUnblockDataButtonLoading,onClick:this.resetUnblockForm},a.default.getLang("login_delayed_its_not_me")))),this.renderDelayedUnblockFinishedScreen=()=>r.createElement("div",{id:"unblock_box_errors_block"},r.createElement("div",{className:"msg submit_error ",dangerouslySetInnerHTML:{__html:a.default.getLang("login_delayed_request_finished")}}),r.createElement("div",{className:"DelayedRequestFinished__button"},r.createElement(c.default,{loading:this.state.redirectToAuthButtonLoading,onClick:this.redirectToAuth},a.default.getLang("login_unblock_redirect_to_auth"))),r.createElement("div",{className:"DelayedRequestFinished__notMeButton"},r.createElement(c.default,{appearance:"tertiary",loading:this.state.resetUnblockDataButtonLoading,onClick:this.resetUnblockForm},a.default.getLang("login_delayed_its_not_me")))),this.render=()=>r.createElement("div",{className:"UnblockForm"},r.createElement("div",{className:"UnblockForm__header box_title_wrap"},r.createElement("div",{className:"box_x_button",role:"button",onClick:s.destroyComponentInBox},r.createElement(f.default,null)),r.createElement("div",{className:"box_title"},a.default.getLang("login_blocked_call_title"))),r.createElement("div",{className:"UnblockForm__content box_body clear_fix"},r.createElement("div",{className:"login_blocked_wrap"},r.createElement("div",{className:"unblock_form"},r.createElement("div",{className:"UnblockForm__content__header"},r.createElement("div",{className:"antispam_team_logo"}),r.createElement("div",{className:"reason"},a.default.getLang("login_unblock_form_explanation"))),this.renderMessage(),this.renderContent())))),this.state={initialLoading:!0},this.references={phoneInput:null,validationCodeInput:null,passwordInput:null,mainButton:null}}setInitialState(){this.setState({message:"",isError:!1,initialLoading:!0,mainButtonLoading:!1,noCodeButtonLoading:!1,resetUnblockDataButtonLoading:!1,redirectToAuthButtonLoading:!1})}getPhoneBlockTooltipLabel(){return this.areCallResetsEnabled()?this.props.tooltips.phoneCallReset:this.props.tooltips.phone}}g.controller="/al_login.php",g.acts={getStatus:"get_unblock_process_status",sendCode:"send_unblock_code",sendCodeToBoundPhone:"send_unblock_code_to_bound_phone",resendCode:"resend_unblock_code",checkCode:"check_unblock_code",unblock:"unblock",resetUnblockForm:"reset_unblock_form"},g.constants={finishedClass:"finished",maxCodeResentAmount:2,noCodeResentAmount:0,firstCountryIndex:0,noResetCodeTimerEnabled:0,tooltipWidth:250,tooltipMarginLeft:5,tooltipAppearance:"white",tooltipPosition:"r",statusSyncRetriesCount:10,statusSyncRetriesTimeoutMicroseconds:1e3,passwordStrengths:{none:-1,incorrectTooShort:0,weakTypical:1,good:2,veryGood:3,excellent:4,incorrectHasSpaces:5}},g.refreshAuthDataAndRedirectToFeed=(e,t,n,r)=>{var o=utilsNode.appendChild(ce("div",{innerHTML:'\n      <form id="login_block_auth_form" target="login_block_auth_frame" action="" method="POST">\n        <input type="hidden" name="_origin" id="login_server_origin" />\n        <input type="hidden" name="email" id="login_block_email" />\n        <input type="hidden" name="pass" id="login_block_pass" />\n      </form>\n      <iframe name="login_block_auth_frame" id="login_block_auth_frame"></iframe>'})),i=window.onLoginDone,a=ge("login_block_auth_form");a.action=(0,h.getLoginDomain)()+"?act=login&ip_h="+t+"&lg_domain_h="+e+"&redirect=1&role=al_frame",val("login_block_email",winToUtf(n)),val("login_block_pass",winToUtf(r)),val("login_server_origin",cur.serverOrigin),a.submit(),cur.destroy.push((()=>{re(o),window.onLoginDone=i})),window.onLoginDone=()=>{re(o),nav.go("/feed",!0)}},g.isBadPassword=e=>{var t=[g.constants.passwordStrengths.incorrectHasSpaces,g.constants.passwordStrengths.incorrectTooShort],n=g.checkPasswordStrength(e);return t.includes(n)},g.checkPasswordStrength=e=>{var t=g.constants.passwordStrengths.none,n=["qwerty","йцукен","gfhjkm","пароль","password","abc123","fuckyou","123abc","baseball","football","soccer","monkey","liverpool","princess","jordan","slipknot","superman","iloveyou"];if(e.length<6)t=g.constants.passwordStrengths.incorrectTooShort;else if(/\s/.test(e))t=g.constants.passwordStrengths.incorrectHasSpaces;else if(e.match(/^\d+$/)||n.indexOf(e)>=0||e.substr(-1).match(/\d/)&&n.indexOf(e.substr(0,e.length-1))>=0)t=g.constants.passwordStrengths.weakTypical;else{for(var r=[/[^a-z]/g,/[^A-Z]/g,/[^а-яё]/g,/[^А-ЯЁ]/g,/[^0-9]/g,/[a-zA-Zа-яА-ЯёЁ0-9]/g],o=[],i=0,a=0,s=r.length;a<s;++a){var c=e.replace(r[a],"").length;c&&(c>1&&i++,o.push({group:a,cnt:c}))}if(o.length<3&&o[o.length-1].group!=r.length-1&&i<2&&(t=g.constants.passwordStrengths.good),(i>2||o.length>2&&o[o.length-1].group==r.length-1)&&(t=g.constants.passwordStrengths.excellent),t<0&&i>1){var l=e.replace(r[r.length-1],"");l.length>1&&l.replace(new RegExp(escapeRE(l.charAt(0)),"g"),"").length&&(t=g.constants.passwordStrengths.excellent)}t<0&&(t=g.constants.passwordStrengths.veryGood),t&&t<3&&e.length>13&&t++}return t},g.renderInitialLoading=()=>r.createElement("div",{className:"InitialLoading"},r.createElement(p.default,null)),g.propTypes={tooltips:o.shape({phone:o.string,phoneCallReset:o.string,code:o.string,codeCallReset:o.string,password:o.string})}},78486:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});n(75115);var r=n(67294),o=n(73935),i=n(45697),a=n(83295),s=n(49030);class c extends r.Component{constructor(e){super(e),this.addTooltip=e=>{if(this.el){var t=this.props,n=t.text,r=t.position,o=t.align,i=t.marginTop,a=t.marginLeft,c=(0,s.default)(this.el);this.update({text:n,position:r,align:o,rect:c,marginTop:i,marginLeft:a})}},this.removeTooltip=e=>{document.activeElement!==this.inputEl&&this.update({remove:!0})},this.renderTooltip=()=>{if(!this.state.tooltip)return null;var e=this.state.tooltip,t=e.x,n=e.y,o=e.position,i=e.align,s=e.text,c=e.removed,l=this.props,u=l.appearance,d=l.width,_=(0,a.classNames)("UnblockTooltip",`UnblockTooltip--${o}`,`UnblockTooltip--${u}`,{"UnblockTooltip--removed":!!c,[`UnblockTooltip--align-${i}`]:"t"===o||"b"===o}),p={top:n,left:t},h=d?{width:d}:{};return r.createElement("div",{className:_,style:p},r.createElement("div",{className:"UnblockTooltip__in",style:h,dangerouslySetInnerHTML:{__html:s}}))},this.state={}}componentDidMount(){this.el=o.findDOMNode(this),this.inputEl="INPUT"===this.el.tagName?this.el:this.el.getElementsByTagName("input")[0],this.backgroundElement=document.getElementById("box_layer_wrap"),this.el.addEventListener("mouseenter",this.addTooltip),this.el.addEventListener("mouseleave",this.removeTooltip),this.inputEl.addEventListener("focus",this.addTooltip),this.inputEl.addEventListener("blur",this.removeTooltip),this.backgroundElement.addEventListener("scroll",this.addTooltip),window.addEventListener("resize",this.addTooltip)}componentWillUnmount(){this.el.removeEventListener("mouseenter",this.addTooltip),this.el.removeEventListener("mouseleave",this.removeTooltip),this.inputEl.removeEventListener("focus",this.addTooltip),this.inputEl.removeEventListener("blur",this.removeTooltip),this.backgroundElement.addEventListener("scroll",this.addTooltip),window.removeEventListener("resize",this.addTooltip)}update(e){var t=e.position,n=e.align,r=e.text,o=e.rect,i=e.marginTop,a=e.marginLeft,s=!o||0===o.top&&0===o.left;if(!0!==e.remove&&this.props.isShown&&!s){var c=o.left,l=o.top;switch(t){case"t":c+=.5*o.width;break;case"r":c+=o.width,l+=.5*o.height;break;case"b":c+=.5*o.width,l+=o.height;break;case"l":l+=.5*o.height}c=Math.round(c+a),l=Math.round(l+i),this.setState({tooltip:{position:t,align:n,text:r,x:c,y:l}})}else this.setState({tooltip:Object.assign({},this.state.tooltip,{removed:!0})})}render(){var e=this.renderTooltip();return e?(this.defaultNode||"undefined"==typeof window||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),r.createElement(r.Fragment,null,this.props.children,o.createPortal(e,this.defaultNode))):this.props.children}}c.propTypes={appearance:i.oneOf(["black","white"]),text:i.string.isRequired,position:i.oneOf(["t","r","b","l"]),align:i.oneOf(["left","center","right"]),marginTop:i.number,marginLeft:i.number,width:i.number,isShown:i.bool,children:i.node},c.defaultProps={appearance:"black",position:"b",align:"center",marginTop:0,marginLeft:0}},68770:(e,t,n)=>{"use strict";n.d(t,{initLoginBoxForm:()=>p,initLoginCombinedBoxForm:()=>h,Login:()=>f});var r=n(7739),o=n(67294),i=n(99284),a=n(81117),s=n(15544),c=n(99937),l=n(28958),u=n(70488),d=n(85048),_=n(59367);function p(e){e&&new l.LoginBoxForm(e)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.querySelector('.LoginRecentBox [name="ul"]'),r=e.querySelector(".LoginRecentBox__alternative"),o=e.querySelector(".LoginRecentBox .LoginBox__title");r.addEventListener("click",(t=>{t.preventDefault(),e.classList.add("LoginCombinedBox--standard")}));var i=new c.LoginRecentUsersGallery(e.querySelector(".LoginRecentBox__users"));i.onChange=e=>{var r=t.users[e];r&&(o.innerHTML=r.title,n&&(n.value=r.encrypted))},i.init(),e.querySelectorAll(".LoginRecentBox__user").forEach(((e,t)=>{e.addEventListener("click",(()=>{i.setIndex(t)}))}))}var f={init(){each(geByClass("big_text","login_form_wrap"),((e,t)=>{placeholderInit(t)})),setTimeout(s.elfocus.pbind(!isVisible("email")||val("email")?"pass":"email"),0);var e=ge("login_form"),t=ge("email"),n=ge("pass"),r=val("login_ul");return e.onsubmit=()=>{if(!window.submitQuickLoginForm)return!0;if(!r&&!trim(t.value))return notaBene(t),!1;if(!trim(n.value))return notaBene(n),!1;var e={expire_input:val("expire_input")};r&&(e.ul=r);var o=(0,d.isEmail)(t.value)?u.RegistrationItemEventTypes.INPUT_EMAIL:u.RegistrationItemEventTypes.INPUT_PHONE;return u.registrationItemStat.logEvent(o,cur.eventScreen,void 0,{force:!0}),submitQuickLoginForm(t.value,n.value,{prg:"login_button",params:e}),!1},window.loginByCredential&&!r&&(t.onclick=loginByCredential,n.onclick=loginByCredential),!0},initBlockedPage(){r.FAQTutorial.tryInit()},initBox(){var e=curBox();e.changed=!0,e.setOptions({width:560,onClean:()=>{},hideButtons:!0,bodyStyle:"padding: 0"}),p(document.querySelector(".LoginBox"))},initVkId(){var e=document.querySelector(".VkIdLogin");e&&(0,_.initVkIdForm)(e)},changeMail(e,t,n){var r=trim(val("login_new_mail")),o=1;return r?(e&&(n=cur.changeMailHash),-1==r.indexOf("@")?showMsg("login_change_mail_error",getLang("reg0_error_bad_email"),"error"):(e&&(o=0),void ajax.post("/login?act=a_change_mail",{newmail:r,hash:n,from_page:o},{onDone(t){var n="login_change_mail_form";e&&(n="login_change_mail_box",curBox().removeButtons(),curBox().addButton(getLang("global_cancel"),null,"no")),val(n,t)},onFail:e=>(showMsg("login_change_mail_error",e,"error"),!0),showProgress:lockButton.pbind(t),hideProgress:unlockButton.pbind(t)}))):notaBene("login_new_mail")},initChangeMailBox(){curBox().removeButtons(),curBox().addButton(getLang("global_cancel"),null,"no"),curBox().addButton(getLang("reg0_change_mail"),f.changeMail.pbind(1)),(0,s.elfocus)("change_mail_new")},isBanExpired:()=>cur.unblockDate<Date.now()/1e3,canUnblockFast:()=>!0===cur.canUnblockFast,showUnblockForm(){(0,a.showComponentInBox)(o.createElement(i.default,{tooltips:{phone:cur.phoneTooltip,phoneCallReset:cur.phoneCallResetTooltip,code:cur.verificationCodeTooltip,codeCallReset:cur.verificationCodeCallResetTooltip,password:cur.passwordTooltip}}))},fastUnblock:e=>{var t={act:"fast_unblock",hash:e},n=document.getElementsByClassName("unblock_button--fast")[0];n?ajax.post("/al_login.php",t,{onDone:function(){showDoneBox(getLang("login_fast_unblocked_wait_description"),{out:5e3}),nav.reload()},onFail:function(e){return unlockButton(n),showDoneBox(e),!0},showProgress:()=>lockButton(n)}):showFastBox(getLang("global_error"))},showDeletePageBox(){showFastBox(getLang("login_blocked_delete_page_header"),getLang("login_blocked_sure_delete_page_question"),getLang("box_yes"),(()=>{ajax.post("al_settings.php",{act:"a_deactivate",hash:cur.deactivate_hash},{onDone:e=>{showDoneBox(e),nav.go("/id"+vk.id)},onFail:e=>{showDoneBox(e),curBox().hideProgress()}})}),getLang("box_no"))}}},91587:(e,t,n)=>{"use strict";n.d(t,{AppOrderBox:()=>l});var r=n(15544),o=n(86125),i=n(86409),a=n(54612),s=n(82452),c=n(65030);class l{static instantSkipAppOrder(e,t){var n=gpeByClass("payments_instant_progress_wrap",e),r={act:"a_order",aid:cur.paymentsOrderAppId,order_id:cur.paymentsOrderId,votes:cur.paymentsPreferVotes,test_mode:cur.paymentsOrderTestMode,_skip_instant:t||1,hash:cur.paymentsOrderHash};void 0!==cur.checkedMaxVotes&&(r.checked_max_votes=cur.checkedMaxVotes),ajax.post("al_apps.php",r,{forceDone:1,onDone:()=>{cur.paymentsCheckOrderCnt=1,(0,o.curBox)().hide(),cur.paymentsCheckOrderCnt=0,cur.fromInstantPay=!0},showProgress:addClass.pbind(n,"loading"),hideProgress:removeClass.pbind(n,"loading")})}static processOrder(e,t){t||(t=(0,o.curBox)());var n=(0,r.isVisible)("payments_box")?2:0,u=!1;e||(e=n),n&&(u=t.btns.ok[0],(0,i.lockButton)(u));var d={act:"a_order",aid:cur.paymentsOrderAppId,order_id:cur.paymentsOrderId,votes:cur.paymentsPreferVotes,from:nav.objLoc[0],test_mode:cur.paymentsOrderTestMode,_votes_ok:e,hash:cur.paymentsOrderHash};1==e&&cur.paymentsOrderBillPeriod&&(d.payment_type=cur.votesType),!cur.paymentsOrderBillPeriod&&ge("payments_order_auto_confirm")&&(d.auto_confirm=(0,i.isChecked)("payments_order_auto_confirm")),ajax.post("al_apps.php",d,{forceDone:3==+e?1:0,onDone:(r,d,_,p,h)=>{if(p&&-1e3!==p&&(cur.votesBoxOptions=p),3==e&&-1e3==_)return c.Gifts.processBoxOptions((0,o.curBox)(),p),cur.paymentsCheckOrderCnt=1,t.hide(),void(cur.paymentsCheckOrderCnt=0);if(0===_||_>0)return cur.paymentsPreferVotes=1,n?cur.paymentsShowBoxError(d):(t.hide(),(0,a.showFastBox)(getLang("global_error"),d)),void((cur.paymentsOrderBillPeriod||h)&&cur.onSubscriptionFail?cur.onSubscriptionFail(_):cur.onAppOrderFail&&cur.onAppOrderFail(_));if(r.result){var f=(0,o.curBox)();return cur.isPaymentsAppOrder=!1,f&&f.hide(),(0,o.showDoneBox)(d),r.balance&&(0,s.updateMoney)(r.balance),void(cur.onSubscriptionDone&&r.subscriptionStatus&&(cur.onSubscriptionDone(r.subscriptionStatus),cur.onSubscriptionDone=!1))}var m=r.orderId;if(m){d&&(t=(0,a.showFastBox)("",d)).setOptions({title:!1,width:520,bodyStyle:"padding: 0;",hideButtons:!0}),u&&(0,i.unlockButton)(u),cur.isPaymentsAppOrder=!1,cur.paymentsOrderId=m,r.subscriptionId&&(cur.paymentsSubscriptionId=r.subscriptionId),cur.paymentsOrderCheckHash=r.checkHash;var g=getLang("payments_waiting_app_order_complete");ge("payments_box_progress_msg_wrap")?(val("payments_box_progress_msg_wrap",`<span id="payments_box_progress_msg">${g}</span>`),cur.paymentsShowProgress()):val("apps_paymentbox_progress_msg_wrap",g),cur.paymentsCheckOrderCnt=0,cur.paymentsCheckOrderInt=setInterval(l.checkOrder,2e3)}else cur.paymentGetOrderItemTO=setTimeout(l.processOrder.pbind(!1,t),1e3)},onFail:function(e){return!e||(cur.onSubscriptionFail?cur.onSubscriptionFail():cur.onAppOrderFail&&cur.onAppOrderFail(),(0,r.isVisible)("payments_box")?cur.paymentsShowBoxError(e):(t.hide(),(0,a.showFastBox)(getLang("global_error"),e)),!0)}})}static checkOrder(){if(15==cur.paymentsCheckOrderCnt)ge("payments_box_progress_msg").innerHTML=getLang("payments_waiting_payment_complete_still");else if(cur.paymentsCheckOrderCnt>30)return clearInterval(cur.paymentsCheckOrderInt),(0,o.curBox)().hide(),void(0,a.showFastBox)(getLang("payments_app_order_box_title"),getLang("payments_app_add_votes_delay"),getLang("global_close"),(()=>{cur.paymentsOrderBillPeriod&&cur.onSubscriptionCancel?cur.onSubscriptionCancel():cur.onAppOrderCancel&&cur.onAppOrderCancel(),(0,o.curBox)().hide()}));cur.paymentsCheckOrderCnt++,ajax.post("al_apps.php",{act:"a_check_order",aid:cur.paymentsOrderAppId,order_id:cur.paymentsOrderId,test_mode:cur.paymentsOrderTestMode,from:nav.objLoc[0],hash:cur.paymentsOrderCheckHash},{onDone:(e,t,n,r,i)=>{e&&((0,o.curBox)()&&(0,o.curBox)().hide(),clearInterval(cur.paymentsCheckOrderInt),cur.paymentsCheckOrderCnt=0,window.toggleFlash(!1),(0,o.showDoneBox)(t,{out:1e3,callback:()=>{window.toggleFlash(!0)}}),n&&(0,s.updateMoney)(n),1==e?(cur.paymentsOrderBillPeriod&&cur.onSubscriptionSuccess?(cur.onSubscriptionSuccess(cur.paymentsSubscriptionId),TopNotifier&&TopNotifier.invalidate()):cur.onAppOrderSuccess&&cur.onAppOrderSuccess(cur.paymentsOrderId),cur.onSubscriptionDone&&i&&(cur.onSubscriptionDone(i),cur.onSubscriptionDone=!1)):cur.paymentsOrderBillPeriod&&cur.onSubscriptionFail?cur.onSubscriptionFail(r):cur.onAppOrderFail&&cur.onAppOrderFail(r))},onFail:function(e){return clearInterval(cur.paymentsCheckOrderInt),cur.paymentsShowBoxError(e),!0}})}static initialize(e,t,n,r,o,i,a){extend(cur,{isPaymentsAppOrder:!0,paymentsAuthPayment:!1,paymentsOrderNotice:!1,paymentsOrderId:e,paymentsOrderAppId:t,paymentsOrderTestMode:n,paymentsOrderHash:r,paymentsPreferVotes:o,paymentsOrderDiscount:i,paymentsOrderBillPeriod:a})}}},62857:(e,t,n)=>{"use strict";n.d(t,{MoneyTransfer:()=>D});n(75115),n(91181),n(79665),n(95767),n(30522),n(66108),n(96253),n(59357),n(83946),n(21466);var r=n(86409),o=n(54612),i=n(15544),a=n(59121),s=n(82452),c=n(95724),l=n(87481),u=n(60615),d=n(86067),_=n(76624),p=n(40774),h=n(97213),f=n(82804),m=n(76852),g=n(19143),v=n(61540);function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||w(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var C=1,S=2,T=-1,D={initHandlers(){(0,f.tq)().setInteractiveHandler("MoneyTransfer/receive_method_change",(e=>{var t=e.payload.event.target;if(!hasClass(t,"disabled")){var n=e.payload.dataAttrs,r=n.value,o=n.name;D.onReceiveMethodChange(t,r,o)}})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/in_chat_focus_amount",(()=>{(0,i.elfocus)("transfer_amount")})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/check_user_message",(()=>{D.checkUserMessage()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/show_hint",(e=>{(0,m.showHint)(e.payload.event.target)})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/send",(e=>{D.send(Boolean(e.payload.dataAttrs.newWindow))})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/check_participate",(e=>{(0,r.checkbox)(e.payload.event.target),D.checkRequestParticipate()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/check",(e=>{(0,r.checkbox)(e.payload.event.target)})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/check_auto_accept",(e=>{(0,r.checkbox)(e.payload.event.target),D.checkAutoAccept()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/about",(e=>{D.aboutBox(e.payload.dataAttrs.aboutKey)})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/history",(()=>{D.historyBox()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/hide_pin_box",(()=>{D.hidePinBox()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/check_vk_pay_offer",(()=>{D.checkVkPayOfferBox()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/clean_amount",(e=>{D.cleanAmount(e.payload.event.target,e.payload.event,Boolean(e.payload.dataAttrs.onlyClean))})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/send_amount_on_enter",(e=>{13===e.payload.event.keyCode&&D.send(),D.autosizeAmount()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/focus_from_to",(e=>{(0,i.elfocus)(e.payload.event,0,1e4)})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/focus_and_hide_link",(e=>{(0,i.elfocus)(e.payload.event,0,1e4),D.hideLinkCopied()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/copy_link",(e=>{D.copyLinkToClipboard(ge(e.payload.dataAttrs.element))})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/share_qr",(()=>{D.shareQRCode()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/download_qr",(()=>{D.downloadQRCode()})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/switch_to_transfer_box",(e=>{D.switchBoxSection(e.payload.event.target,"transfer")})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/switch_to_request_box",(e=>{D.switchBoxSection(e.payload.event.target,"request")})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/switch_to_link_box",(e=>{D.switchBoxSection(e.payload.event.target,"link")})),(0,f.tq)().setInteractiveHandler("MoneyTransfer/init_accept",(()=>{D.initAccept(cur.paymentsOptions.chkData,cur.paymentsOptions.frame,!0)}))},init(){this.initHandlers();var e=curBox();if(ge("payments_box")!=geByClass1("payments_money_transfer_box",e.bodyNode)&&_message_boxes.length>1){var t=!0;_message_boxes.forEach((function(e,n){t&&ge("payments_box")==geByClass1("payments_money_transfer_box",e.bodyNode)&&(boxLayer.removeChild(gpeByClass("popup_box_container",e.bodyNode)),boxQueue._boxes.splice(n,1),delete _message_boxes[n],t=!1)}))}if(cur.moneyLinksTooltip&&(cur.moneyLinksTooltip.destroy(),delete cur.moneyLinksTooltip),e.setOptions({grey:!0}),cur.paymentsOptions.requestId&&!cur.paymentsOptions.vkpayAvailable&&(e.changed=!0,e.setOptions({width:510}),D.send()),placeholderInit("transfer_amount"),placeholderInit("transfer_comment"),cur.paymentsOptions.isChat){if(placeholderInit("transfer_chunk_amount"),cur.autoacceptCardDD=new InlineDropdown("transfer_autoaccept_card",{items:cur.paymentsOptions.cards,selected:cur.paymentsOptions.cardSeleceted,withArrow:!0,onShow:D.enableAutoaccept,onSelect:e=>{-1==e?D.sendBind():cur.paymentsOptions.vkpayAvailable&&D.checkAmount(val("transfer_amount"))}}),cur.autoacceptCardEl=ge("transfer_autoaccept_card"),(0,i.toggleClass)("transfer_autoaccept_card","disabled",!cur.paymentsOptions.autoAcceptEnabled),cur.paymentsOptions.autoAcceptEnabled&&(0,r.checkbox)("transfer_autoaccept",!0),cur.paymentsOptions.cards.length<2){var n=(0,i.ce)("a",{id:"payments_money_transfer_new_card_lnk",innerHTML:(0,d.getLang)("payments_money_transfer_new_card")});addEvent(n,"mousedown",D.sendBind),(0,i.hide)(cur.autoacceptCardEl),cur.autoacceptCardEl.parentNode.appendChild(n)}}else if(ge("transfer_to")){(0,i.hide)("payments_money_transfer_user");var o="transfer"===cur.paymentsOptions.boxTab;cur.uiTransferTo=new Dropdown(ge("transfer_to"),cur.paymentsOptions.friends.filter((function(e){return o||!0===e[7]})),{big:!0,introText:(0,d.getLang)("votes_transfer_start_typing_recipient"),noResult:"",placeholder:(0,d.getLang)("votes_transfer_choose_recipients"),placeholderColored:!0,multiselect:!1,enableCustom:!0,autocomplete:!0,imageId:"transfer_to_photo",indexkeys:[1,4],noImageSrc:"/images/blank.gif",onChange:e=>{if(e&&-1!=e){var t=cur.uiTransferTo.val_full();cur.paymentsOptions.toId=t[0],cur.paymentsOptions.hash=t[5],val("payments_money_transfer_summary",t[6]),setTimeout(i.elfocus.pbind("transfer_amount"),100),cur.paymentsOptions.vkpayAvailable&&D.updateMethods()}}})}else ge("transfer_method")&&D.initMethods();setTimeout(i.elfocus.pbind("transfer_amount"),100),shortCurrency(),"link"===cur.paymentsOptions.boxTab&&D.genQRCode();var a=val("transfer_amount");a&&D.checkAmount(a,!1,!0),D.autosizeAmount(),D.showMoneyLinksTooltip(),cur.transferPageLoaded=!1,cur.destroy.push(D.destroy)},destroy(){D.stopCheckFrameLoad(),cur.uiTransferTo&&cur.uiTransferTo.destroy(cur.uiTransferTo),cur.qrFrame&&(0,i.re)(cur.qrFrame)},initMethods(){cur.paymentsOptions.onlyCards=!(0,i.isVisible)("payments_money_transfer_receive_methods");var e=cur.paymentsOptions.cardSelected;if([S,C].includes(parseInt(cur.paymentsOptions.forceType))){var t,n=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=w(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(cur.paymentsOptions.cards);try{for(n.s();!(t=n.n()).done;){E(t.value,1)[0]===T&&(e=T)}}catch(e){n.e(e)}finally{n.f()}}(cur.uiTransferCard=new Dropdown(ge("transfer_method"),cur.paymentsOptions.cards,{big:!0,selectedItems:e,onChange:(e,t)=>{if(-2===parseInt(e)){var n=(0,i.se)(t);return nav.go(n.getAttribute("data-url")),(0,r.lockButton)("payments_money_transfer_send"),!1}D.updateTransferType(),D.updateCardFee(!0),val("transfer_amount")||setTimeout(i.elfocus.pbind("transfer_amount"),100)}}),cur.paymentsOptions.onlyCards)||geByClass1("payments_money_transfer_receive_options","payments_money_transfer_receive_methods")&&(window.radioBtns.receiveOptions={els:Array.prototype.slice.apply((0,i.geByClass)("radiobtn")),val:e==T?"vkpay":"cards"});if(void 0!==cur.paymentsOptions.vkpayBalance&&((0,c.each)((0,i.geByClass)("_code","payments_money_transfer_code_wrap"),(function(){addEvent(this,"mousedown",D.onPinClick),addEvent(this,"keyup",D.onPinKeyUp),addEvent(this,"keypress",D.onPinEnter)})),D.isVKPayFillUpEnabled())){var o=D.getBindCards();o.length>0&&(cur.uiFillUpCard=new Dropdown(ge("fill_up_card"),o,{big:!0,selectedItems:cur.paymentsOptions.fillUpCardSelected}))}var a=!cur.paymentsOptions.transferType||cur.paymentsOptions.forceType;a&&D.updateTransferType(),D.updateCardFee(!a)},updateLocalStorageNewWindowSign(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+20+20*Math.random());return localStorage.setItem("money_transfer_new_window",t.getTime()),t},getLocalStorageNewWindowSign(){var e,t=parseInt(null!==(e=localStorage.getItem("money_transfer_new_window"))&&void 0!==e?e:0);if(1===t)t=D.updateLocalStorageNewWindowSign().getTime();else if(0===t)return!1;return t>(new Date).getTime()},updateMethods(){var e,t=cur.paymentsOptions.toId;if(t&&cur.paymentsOptions.vkpayAvailable){var n=ge("payments_money_transfer_send");val("payments_box_error",""),cur.moneyTranferMethodsReq&&(cur.moneyTranferMethodsReq.abort(),cur.moneyTranferMethodsReq=null),"request"!==(null===(e=cur.paymentsOptions)||void 0===e?void 0:e.boxTab)&&(cur.moneyTranferMethodsReq=ajax.post("al_payments.php?act=a_get_money_transfer_methods",{to_id:t},{onDone:(e,t)=>{(0,r.unlockButton)(n),val("payments_money_transfer_methods",e),cur.paymentsOptions=extend(cur.paymentsOptions,t),cur.paymentsOptions.transferType=t.transferType,D.initMethods()},onFail:e=>(e&&isString(e)&&((0,r.unlockButton)(n),D.showError(e)),!0),showProgress:r.lockButton.pbind(n)}))}},send(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=curBox(),o=ge("payments_money_transfer_send");if(!(0,r.isButtonLocked)(o))if(cur.paymentsOptions.toId||!cur.uiTransferTo){var a=0;if(D.resetTransferWindow(),!(0,i.isVisible)("payments_money_transfer_no_amount_wrap")){if(!(a=val("transfer_amount"))||a<=0)return(0,i.addClass)("payments_money_transfer_amount_wrap","money_error"),setTimeout(i.removeClass.pbind("payments_money_transfer_amount_wrap","money_error"),500),void(0,i.elfocus)("transfer_amount");if(!D.checkAmount(a,!0))return;if((0,r.isChecked)("transfer_participate"))a-=D.getChunkAmount(a,!0)}if(D.hideMoneyLinksTooltip(),cur.paymentsOptions.onSendStart&&cur.paymentsOptions.onSendStart(),"request"!==cur.paymentsOptions.boxTab){D.createFrame();var s={act:"a_init_money_transfer",to_id:cur.paymentsOptions.toId,owner_id:cur.paymentsOptions.ownerId,amount:a,currency:cur.paymentsOptions.currency,comment:val("transfer_comment"),from:cur.paymentsOptions.from,hash:cur.paymentsOptions.hash,accept_vk_pay_offer:cur.paymentsOptions.shouldAcceptVkPayOffer};if(cur.paymentsOptions.vkpayAvailable&&(s.card_id=cur.uiTransferCard.val(),cur.paymentsOptions.onlyCards||(s.receive_method=radioval("receiveOptions")),"-1"===s.card_id)){if(!t)return void D.showPinBox();s.vkpay_pin=t}if(D.isVKPayTransfer()&&D.isVKPayFillUpEnabled()&&D.isFillUpCardSelectionVisible()&&(s.fill_up_card_id=cur.uiFillUpCard.val()),cur.paymentsOptions.requestId&&(s.request_id=cur.paymentsOptions.requestId),cur.paymentsOptions.statSessionId&&(s.stat_session_id=cur.paymentsOptions.statSessionId),val("payments_box_error",""),e||!localStorage||this.isVKPayTransfer()||"-1"===s.card_id||(e=D.getLocalStorageNewWindowSign()),e){cur.paymentsOptions.qid&&(s.act="a_continue_money_transfer",s.qid=cur.paymentsOptions.qid),cur.transferWindow=window.open("","Money Transfer");var c=p.PaymentsBox.popupHtml((0,d.getLang)("payments_cards_redirect"),"","");cur.transferWindow.document.write(c)}ajax.post("al_payments.php",s,{onDone:(t,o)=>{var a;o?(cur.paymentsOptions.qid=t.qid,e?cur.transferWindow?D.updateTransferWindow(o):D.showError((0,d.getLang)("payments_payment_cancelled"),"info_msg"):(cur._popup_text=o,cur._popup_callback=function(){(0,i.hide)("payments_money_transfer_wrap","payments_money_transfer_buttons","payments_box_error","payments_money_transfer_prg","payments_iframe_cookie_disabled_div"),show("payments_money_transfer_iframe","payments_iframe_container"),cur.uiTransferTo&&((0,i.hide)("payments_money_transfer_user_select"),show("payments_money_transfer_user")),ge("payments_iframe_container").scrollTop=0,window.addEventListener("message",D.frameMessage,!1),n.changed=!0,n.setOptions({width:510}),!cur.paymentsOptions.requestId&&(0,i.isVisible)(n.titleWrap)&&n.setBackTitle(D.resetSendBox),setStyle(a,{width:ge("payments_iframe_container").parentNode.offsetWidth-(0,r.sbWidth)()+"px"})},(a=ge("transfer_iframe")).contentWindow.document.open("text/html","replace"),a.contentWindow.document.write(o),a.contentWindow.document.close(),cur._popup_callback(),D.startCheckFrameLoad(+new Date))):(cur.paymentsOptions.receiptRedesign&&window.addEventListener("message",D.frameMessage,!1),(0,i.hide)("payments_money_transfer_wrap","payments_money_transfer_buttons","payments_box_error","payments_iframe_container",geByClass1("payments_money_transfer_mc_info_msg","payments_money_transfer_iframe")),cur.uiTransferTo&&((0,i.hide)("payments_money_transfer_user_select"),show("payments_money_transfer_user")),show("payments_money_transfer_iframe","payments_money_transfer_prg"));D.startCheckStatus(t,e)},onFail:e=>(D.resetTransferWindow(),D.showError(e),!0),showProgress:r.lockButton.pbind(o),hideProgress:r.unlockButton.pbind(o)})}else D.sendRequest(a)}else(0,r.notaBene)(cur.uiTransferTo.container)},sendRequest(e){var t=ge("payments_money_transfer_send"),n={to_id:cur.paymentsOptions.toId,owner_id:cur.paymentsOptions.ownerId,amount:e,currency:cur.paymentsOptions.currency,comment:val("transfer_comment"),from:cur.paymentsOptions.from,hash:cur.paymentsOptions.hash};if(cur.paymentsOptions.statSessionId&&(n.stat_session_id=cur.paymentsOptions.statSessionId),cur.paymentsOptions.isChat){if(n.total_amount=parseInt(e),n.amount=parseInt(val("transfer_chunk_amount")),n.pin_message=(0,r.isChecked)("transfer_pin_message")?1:0,(0,r.isChecked)("transfer_autoaccept")&&(cur.autoacceptCardDD&&(n.accept_card=cur.autoacceptCardDD.val()),!n.accept_card||-1==n.accept_card))return D.showError((0,d.getLang)("payments_money_request_error_no_accept_card")),!1;var o=!1,i=D.getTransferLimit("minAmount"),a=D.getTransferLimit("maxAmount");if(i&&n.amount<i?o=(0,d.getLang)("payments_money_request_error_min_chunk_amount_currency"):a&&n.amount>a?o=(0,d.getLang)("payments_money_request_error_max_chunk_amount_currency"):n.total_amount&&n.amount>n.total_amount&&(o=(0,d.getLang)("payments_money_request_error_chunk_amount_too_big")),o)return D.showError(o),(0,r.notaBene)("transfer_chunk_amount"),!1}val("payments_box_error",""),ajax.post("al_payments.php?act=a_send_money_request",n,{onDone:e=>{curBox().hide(),showDoneBox(e,{out:6e3})},onFail:e=>(D.showError(e),!0),showProgress:r.lockButton.pbind(t),hideProgress:r.unlockButton.pbind(t)})},sendBind(){var e=curBox();D.createFrame(),(0,i.hide)("payments_money_transfer_wrap","payments_money_transfer_buttons","payments_box_error","payments_money_transfer_summary_wrap","payments_iframe_container",geByClass1("msg","payments_money_transfer_iframe"),geByClass1("tb_tabs_wrap",e.bodyNode)),show("payments_money_transfer_iframe","payments_money_transfer_prg"),e.setBackTitle(D.resetSendBox),e.setOptions({width:510});var t={type:"card",only_auth:1,hash:cur.paymentsOptions.bindHash};val("payments_box_error",""),ajax.post("al_payments.php?act=a_getvotes_charge",t,{onDone:(t,n)=>{var o;cur._popup_text=n,cur._popup_callback=function(){(0,i.hide)("payments_money_transfer_prg"),show("payments_iframe_container"),ge("payments_iframe_container").scrollTop=0,window.addEventListener("message",D.frameMessage,!1),cur.autoacceptCardDD&&(0,i.isVisible)(cur.autoacceptCardEl)&&cur.autoacceptCardDD.select(cur.paymentsOptions.cards[0][0]),e.changed=!0,setStyle(o,{width:ge("payments_iframe_container").parentNode.offsetWidth-(0,r.sbWidth)()+"px"})},(o=ge("transfer_iframe")).contentWindow.document.open("text/html","replace"),o.contentWindow.document.write(n),o.contentWindow.document.close(),cur._popup_callback(),cur.isPaymentCanceled=cur.isPaymentFailed=!1,cur.moneyTranferCheckInt=setInterval((function(){D.checkBindStatus(t),(cur.isPaymentCanceled||cur.isPaymentFailed)&&(clearInterval(cur.moneyTranferCheckInt),cur.isPaymentFailed?D.showError((0,d.getLang)("payments_landing_cancelled")):D.showError((0,d.getLang)("payments_payment_cancelled"),"info_msg"))}),2e3)},onFail:e=>(D.showError(e),!0)})},createFrame(){var e=ge("payments_iframe_container"),t=(0,i.ce)("iframe",{id:"transfer_iframe",name:"transfer_iframe"},{border:0,height:"445px",width:510-(0,r.sbWidth)()+"px",overflowX:"hidden",overflowY:"hidden"});t.frameBorder=0,e.innerHTML="",e.appendChild(t)},popupWrite(e){if(e.document.innerHTML!==cur._popup_text){e.document.write(cur._popup_text),e.document.close();try{e.document.charset="windows-1251"}catch(e){}e.blur(),e.focus(),cur._popup_callback&&cur._popup_callback()}},resetSendBox(){var e=curBox();if(e){var t=geByClass1("tb_tabs_wrap",e.bodyNode);(0,i.hide)("payments_money_transfer_iframe"),show("payments_money_transfer_wrap","payments_money_transfer_buttons","payments_money_transfer_summary_wrap",t,geByClass1("payments_money_transfer_mc_info_msg","payments_money_transfer_iframe")),cur.uiTransferTo&&((0,i.hide)("payments_money_transfer_user"),show("payments_money_transfer_user_select")),t&&e.setOptions({title:""}),e.changed=!1,e.setOptions({width:510}),(0,i.isVisible)(e.titleWrap)&&e.setBackTitle(!1)}},resetTransferWindow(){cur.transferWindow&&(show("payments_money_transfer_wrap","payments_money_transfer_buttons"),(0,i.hide)("payments_money_transfer_prg","payments_money_transfer_iframe"),cur.transferWindow.location=window.location,cur.transferWindow.close()),cur.transferWindow=void 0},updateTransferWindow(e){var t=cur.transferWindow.document.getElementById("wait_text_container");t&&(t.innerHTML=""),cur.transferWindow.document.write(e),setTimeout((()=>{var e;null===(e=cur.transferWindow.document.getElementById("popup_payment_form"))||void 0===e||e.submit()}),1500),window.addEventListener("message",D.frameMessage,!1),(0,i.hide)("payments_money_transfer_wrap","payments_money_transfer_buttons","payments_box_error","payments_iframe_safari_trouble_div","payments_iframe_container"),val("payments_transfer_box_progress_msg",(0,d.getLang)("payments_waiting_transfer_complete")),show("payments_money_transfer_iframe","payments_money_transfer_prg")},startCheckStatus(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];cur.isPaymentCanceled=cur.isPaymentFailed=!1,cur.moneyTransferRedirected=!1,cur.moneyTranferCheckInt&&clearInterval(cur.moneyTranferCheckInt),cur.moneyTranferCheckInt=setInterval((function(){if(D.checkStatus(e,t),cur.isPaymentCanceled||cur.isPaymentFailed){var n=D.resetTransferWindow();if(n&&n(),clearInterval(cur.moneyTranferCheckInt),e.accept)return void curBox().hide();cur.isPaymentFailed?D.showError((0,d.getLang)("payments_landing_cancelled")):D.showError((0,d.getLang)("payments_payment_cancelled"),"info_msg")}}),2e3)},hideBoxQueue(){for(;boxQueue.count();)boxQueue.hideLast(!1)},stopListeningFrameMessages(){window.removeEventListener("message",D.frameMessage,!1)},checkStatus(e,t){var n={act:"a_check_money_transfer",qid:e.qid,hash:e.hash};e.accept&&(n.accept=e.accept),ajax.post("al_payments.php",n,{onDone:(n,a,s,c)=>{if(!n||4==n&&cur.moneyTransferRedirected){var l;t&&(null===(l=cur.transferWindow)||void 0===l?void 0:l.closed)&&(D.showError((0,d.getLang)("payments_payment_cancelled")),D.stopListeningFrameMessages(),D.resetTransferWindow(),cur.isPaymentFailed=!1,cur.isPaymentCanceled=!1)}else{if(1==n||3==n){if(t)0===cur.paymentsOptions.transferType||cur.paymentsOptions.transferType===C?cur.transferWindow&&!cur.transferWindow.closed&&(D.resetTransferWindow(),D.hideBoxQueue()):(D.resetTransferWindow(),D.hideBoxQueue());else cur.paymentsOptions.transferType===S?(D.resetTransferWindow(),D.hideBoxQueue()):cur.paymentsOptions.receiptRedesign&&((0,i.hide)(document.querySelector(".payments_money_transfer_footer")),(null==c?void 0:c.receipt_link)&&D.setIframeByLink(c.receipt_link));c||showDoneBox(a,{out:6e3});var u=nav.objLoc;e.accept||"settings"!==u[0]||"payments"!==u.act||"transfer"!==u.section||(cur.historyOffset||(cur.historyOffset={}),cur.historyOffset.transfer=0,(0,g.showNextPaymentsHistory)(!1,u.section)),3==n&&(c&&c.title&&(0,o.showFastBox)({title:c.title},a,(0,d.getLang)("payments_remember_card_btn"),D.rememberAcceptCard.pbind(c),(0,d.getLang)("payments_dont_remember_card_btn")),TopNotifier.invalidate(),cur.acceptMoneyBtn&&hasClass((0,i.domPN)(cur.acceptMoneyBtn),"feedback_buttons")?((0,i.re)((0,i.domPN)(cur.acceptMoneyBtn)),cur.acceptMoneyBtn=!1):cur.acceptMoneyBtn&&((0,i.re)(geByClass1("_decline_btn",(0,i.domPN)(cur.acceptMoneyBtn))),domReplaceEl(cur.acceptMoneyBtn,s),cur.acceptMoneyBtn=!1))}else if(2==n||5==n)D.showError(a),D.stopListeningFrameMessages(),cur.isPaymentFailed=!1,cur.isPaymentCanceled=!1;else{if(4==n){var _;if(cur.moneyTransferRedirected=!0,cur._popup_text=s,t&&cur.transferWindow)D.updateTransferWindow(s);else cur._popup_callback=function(){(0,i.hide)("payments_money_transfer_prg"),show("payments_iframe_container"),ge("payments_iframe_container").scrollTop=0,window.addEventListener("message",D.frameMessage,!1),curBox().changed=!0,setStyle(_,{width:ge("payments_iframe_container").parentNode.offsetWidth-(0,r.sbWidth)()+"px"})},(_=ge("transfer_iframe")).contentWindow.document.open("text/html","replace"),_.contentWindow.document.write(s),_.contentWindow.document.close(),cur._popup_callback();return}if(6==n)return void((0,i.isVisible)("payments_money_transfer_prg")||((0,i.hide)("payments_iframe_container"),show("payments_money_transfer_iframe","payments_money_transfer_prg")))}clearInterval(cur.moneyTranferCheckInt)}},onFail:e=>(clearInterval(cur.moneyTranferCheckInt),D.resetTransferWindow()(),D.showError(e),!0)})},checkBindStatus(e){var t={act:"a_getvotes_check",type:"card"};e&&(e.oid||e.qid)&&(t.oid=e.oid,t.qid=e.qid,t.hash=e.hash),ajax.post("al_payments.php",t,{onDone:(e,t,n)=>{e&&(1==e?(D.resetSendBox(),D.enableAutoaccept(),n&&cur.autoacceptCardDD&&((0,i.isVisible)(cur.autoacceptCardEl)||((0,i.hide)(geByTag("A",cur.autoacceptCardEl.parentNode)[0]),show(cur.autoacceptCardEl)),cur.paymentsOptions.cards.unshift([n.bindingId,n.bin]),cur.autoacceptCardDD.setItems(cur.paymentsOptions.cards),cur.autoacceptCardDD.select(n.bindingId))):2!=e&&10!=e||D.showError(t),clearInterval(cur.moneyTranferCheckInt))},onFail:e=>(clearInterval(cur.moneyTranferCheckInt),D.showError(e),!0)})},paymentCanceled(e){e?cur.isPaymentFailed=!0:cur.isPaymentCanceled=!0,D.frameHeight()},frameHeight(e,t){var n=ge("transfer_iframe");e?(e=Math.max(e,250),cur.prevFrameHeight=n.style.height,n.style.height=e+"px"):(n.style.height=cur.prevFrameHeight,(0,i.removeClass)("payments_iframe_container","payments_threeds_frame")),t||(ge("payments_iframe_container").style.height=(e||cur.prevFrameHeight)+15+"px"),ge("payments_iframe_container").scrollTop=0},frameMessage(e){var t;if(curBox()||!cur.paymentsOptions.receiptRedesign){if(!(e.origin.match(/^https?:\/\/([a-zA-Z0-9\-.]+\.)?money\.mail\.ru$/)||e.origin.match(new RegExp(`^https?:\\/\\/([a-zA-Z0-9\\-.]+\\.)?${v.VK_SITE_REGEX_SOURCE_UNSAFE}$`))&&(null===(t=cur.paymentsOptions)||void 0===t?void 0:t.receiptRedesign)))return!1;var n={};if(!e.data||"{"!==e.data.substr(0,1)||"billing"===(n=(0,s.parseJSON)(e.data)).type){vk.dev&&(0,l.debugLog)(n);var r=geByClass1("payments_iframe_container",curBox().bodyNode)||ge("payments_iframe_container");if(cur.transferPageLoaded=!0,"resizeFrame"===n.action?setTimeout(D.frameHeight.pbind(n.action_params.height),200):"submit"===e.data||"3dsPage"===n.action?(setTimeout(D.frameHeight.pbind(600,!0),200),(0,i.addClass)(r,"payments_threeds_frame")):"3dsFinish"===n.action?(D.frameHeight(),(0,i.removeClass)(r,"payments_threeds_frame")):"session_fail"===n.action?((0,i.hide)(r),D.resetTransferWindow(),show("payments_iframe_safari_trouble_div"),D.updateLocalStorageNewWindowSign()):"putPixel"===n.action&&"page_load"===n.action_params.alias?(p.PaymentsBox.finishFormMeasure("dmr_transfer"),(0,u.statlogsValueEvent)("money_transfers",0,"iframe_loaded")):"paySuccess"===n.action&&setTimeout(D.frameHeight.pbind(500),300),cur.paymentsOptions.receiptRedesign){if("make_one_more_transfer"===n.action||"close_window"===n.action)switch(clearInterval(cur.moneyTranferCheckInt),D.resetTransferWindow(),D.stopListeningFrameMessages(),n.action){case"make_one_more_transfer":D.resetSendBox();break;case"close_window":D.hideBoxQueue()}if("get_transfer_source"===n.action){var o=vk.dev?"*":window.location.origin;cur.transferWindow&&cur.transferWindow.postMessage(JSON.stringify({from:cur.paymentsOptions.from}),o);var a=ge("transfer_iframe");a&&a.contentWindow.postMessage(JSON.stringify({action:"set_transfer_source",source:cur.paymentsOptions.from}),o)}}}}else D.stopListeningFrameMessages()},setIframeByLink(e){var t=geByClass1("payments_iframe_container",curBox().bodyNode)||ge("payments_iframe_container"),n=(0,i.ce)("iframe",{id:"transfer_iframe",name:"transfer_iframe"},{border:0,height:"445px",width:"510px",overflowX:"hidden",overflowY:"hidden"});n.frameBorder=0,t.innerHTML="",t.appendChild(n),(0,i.hide)(ge("payments_money_transfer_prg")),show(t),n.src=e},startCheckFrameLoad(e){cur.frameLoadChecker=setInterval((function(){cur.transferPageLoaded?D.stopCheckFrameLoad():+new Date-e>5e3&&(D.stopCheckFrameLoad(),D.resetTransferWindow(),(0,i.hide)("payments_iframe_container"),show("payments_iframe_safari_trouble_div"),D.updateLocalStorageNewWindowSign())}),1e3)},stopCheckFrameLoad(){clearInterval(cur.frameLoadChecker)},initAccept(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)cur.transferWindow=window.open("/","Money transfer"),cur.transferWindow.document.write(t),(0,i.hide)("payments_box_error","payments_iframe_container","payments_iframe_safari_trouble_div","payments_iframe_container"),val("payments_transfer_box_progress_msg",(0,d.getLang)("payments_waiting_transfer_complete")),show("payments_money_transfer_iframe","payments_money_transfer_prg");else{var r=geByClass1("payments_iframe_container",curBox().bodyNode)||ge("payments_iframe_container");show(r);var o=(0,i.ce)("iframe",{id:"transfer_iframe",name:"transfer_iframe"},{border:0,height:"445px",width:"510px",overflowX:"hidden",overflowY:"hidden"});o.frameBorder=0,r.innerHTML="",r.appendChild(o),o.contentWindow.document.open("text/html","replace"),o.contentWindow.document.write(t),o.contentWindow.document.close(),D.startCheckFrameLoad(+new Date)}window.addEventListener("message",D.frameMessage,!1),D.startCheckStatus(e,n)},rememberAcceptCard(e){var t=curBox()||{},n=t.btns.ok[0];ajax.post("al_payments.php?act=a_remember_money_transfer_accept_card",{card_id:e.card_id,hash:e.hash},{onDone:t.hide,showProgress:r.lockButton.pbind(n),hideProgress:r.unlockButton.pbind(n)})},cleanAmount(e,t,n){if(13!==t.keyCode){var r=e.value.replace(/[^0-9]/g,"");r=r.replace(/^0+/,""),e.value!=r&&(e.value=r),n||(D.checkAmount(r),D.autosizeAmount(),cur.paymentsOptions.cardsFee&&D.updateCardFee(!0))}},getTransferLimit(e){var t="request"===cur.paymentsOptions.boxTab?0:cur.paymentsOptions.transferType;return"balance"===e&&parseInt(t)===S?cur.paymentsOptions.vkpayBalance:(cur.paymentsOptions.isChat&&"request"===cur.paymentsOptions.boxTab&&"maxAmount"===e&&cur.autoacceptCardDD&&-2===cur.autoacceptCardDD.val()&&(t=2),cur.paymentsOptions.limits[t][e])},checkAmount(e,t,n){var a,s=!1,c=hasClass("payments_money_transfer_amount_wrap","money_error"),l=parseInt(null===(a=cur.uiTransferCard)||void 0===a?void 0:a.val())===T,u=D.isVKPayTransfer(),_=D.isVKPayFillUpEnabled();if(t&&c)return u&&e>D.getTransferLimit("balance")&&!_&&(0,o.showFastBox)({title:(0,d.getLang)("payments_vkpay_low_balance_title"),width:420},(0,d.getLang)("payments_vkpay_low_balance_text"),(0,d.getLang)("payments_vkpay_topup_button"),nav.go.pbind("/vkpay#action=refill"),(0,d.getLang)("global_close")),!1;var p=cur.paymentsOptions.isChat&&"request"===cur.paymentsOptions.boxTab,h=p&&(0,r.isChecked)("transfer_participate"),f=D.getTransferLimit("minAmount")*(h?2:1),m=D.getTransferLimit("maxAmount"),g=D.getTransferLimit("balance"),v=langNumeric(f,cur.paymentsOptions.currencyStr,!0),y=(0,d.getLang)("payments_money_transfer_amount_limits").replace("{min_amount}",v),E=!p;if(p&&cur.autoacceptCardDD&&-2===cur.autoacceptCardDD.val()&&(E=!0),l&&u&&_&&!(void 0!==g&&e<=g)||D.hideFillUpCardSelection(),t&&f&&e<f)s=(0,d.getLang)("payments_money_transfer_error_min_amount_currency").replace("{min_amount}",v);else if(m&&E&&e>m){var w=langNumeric(m,cur.paymentsOptions.currencyStr,!0);s=(0,d.getLang)("payments_money_transfer_error_max_amount_currency").replace("{max_amount}",w)}else if(l&&void 0!==g&&e>g){if(u&&_)D.getBindCards().length>0?D.showFillUpCardSelection():s=(0,d.getLang)("payments_money_transfer_low_balance");else s=(0,d.getLang)("payments_money_transfer_low_balance")}var b=ge("payments_money_transfer_notice");if(0!=s)return val(b,s),(0,i.addClass)("payments_money_transfer_amount_wrap","money_error"),!1;if((c||n||e<f)&&((e<f||"request"===cur.paymentsOptions.boxTab)&&val(b,y),(0,i.removeClass)("payments_money_transfer_amount_wrap","money_error")),!t&&p){var C=D.getChunkAmount(e,h);if(val("transfer_chunk_amount",C),f&&e<f)val(b,y);else{var S=langNumeric(h?e-C:e,cur.paymentsOptions.currencyStr,!0);val(b,(0,d.getLang)("payments_money_transfer_will_be_requested").replace("{amount}",S))}}return!0},getChunkAmount(e,t){var n=D.getTransferLimit("minAmount"),r=D.getTransferLimit("maxAmount"),o=Math.max(n||100,Math.ceil(e/Math.max(1,cur.paymentsOptions.chatCount-(t?0:1))));return r&&(o=Math.min(o,r)),o},autosizeAmount(){var e=ge("transfer_amount"),t=(0,i.ce)("span",{innerHTML:e.value||"0"},{fontFamily:getStyle(e,"fontFamily"),fontSize:getStyle(e,"fontSize"),fontWeight:getStyle(e,"fontWeight")});ge("utils").appendChild(t);var n=Math.floor(getSize(t)[0])+50;(0,i.re)(t),cur.amountMinSize||(cur.amountMinSize=80),n<cur.amountMinSize&&(n=cur.amountMinSize),setStyle(e,{width:n})},checkUserMessage(){checkTextLength(cur.paymentsOptions.maxTextLength,ge("transfer_comment"),ge("transfer_comment_limit_message"),!1,!0),(val("transfer_comment_limit_message")&&(0,i.isVisible)("transfer_comment_limit_message")?i.hide:show)("payments_money_transfer_fee_link")},checkRequestParticipate(){D.checkAmount(val("transfer_amount"))},checkRequestNoAmount(e,t){e&&uiTabs.switchTab(e),t?((0,i.hide)("payments_money_transfer_amount_wrap","transfer_participate"),show("payments_money_transfer_no_amount_wrap")):((0,i.hide)("payments_money_transfer_no_amount_wrap"),show("payments_money_transfer_amount_wrap","transfer_participate"),(0,i.elfocus)("transfer_amount"))},checkAutoAccept(){(0,i.toggleClass)("transfer_autoaccept_card","disabled",!(0,r.isChecked)("transfer_autoaccept"))},enableAutoaccept(){(0,r.isChecked)("transfer_autoaccept")||((0,r.checkbox)("transfer_autoaccept",!0),(0,i.removeClass)("transfer_autoaccept_card","disabled"))},showMoneyTransferBox(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return showBox("al_payments.php",y({},e,{act:"money_transfer_box"}),y({},t,{onDone(e,t){null==r||r(),cur.paymentsOptions=t,e.setOptions({width:510,bodyStyle:"padding: 0;",hideButtons:!0,onClean(){cur.moneyTranferCheckInt&&clearInterval(cur.moneyTranferCheckInt),nav.objLoc.z&&"moneysend"===nav.objLoc.z.substr(0,9)&&(delete nav.objLoc.z,nav.setLoc(nav.objLoc))}}),D.init()},onFail:n}))},aboutBox:e=>!(0,o.showFastBox)({title:(0,d.getLang)("payments_money_transfer_about_title"),width:560},(0,d.getLang)(e)),showError(e,t){e&&(ge("payments_box_error").innerHTML="",(0,a.showMsg)("payments_box_error",e,t||"error"),show("payments_box_error")),ge("payments_money_transfer_wrap")&&(D.resetSendBox(),cur.moneyTranferCheckInt&&(clearInterval(cur.moneyTranferCheckInt),cur.moneyTranferCheckInt=!1))},switchBoxSection(e,t){cur.paymentsOptions.boxTab!==t&&(e&&uiTabs.switchTab(e),"transfer"===cur.paymentsOptions.boxTab&&(0,i.isVisible)("payments_money_transfer_iframe")&&(D.resetSendBox(),cur.moneyTranferCheckInt&&(clearInterval(cur.moneyTranferCheckInt),cur.moneyTranferCheckInt=!1)),"transfer"===cur.paymentsOptions.boxTab&&cur.paymentsMoneyBoxTTHide&&cur.paymentsMoneyBoxTTHide(),"link"===cur.paymentsOptions.boxTab&&((0,i.hide)("payments_money_link_box"),show("payments_money_transfer_request_box"),D.hideMoneyLinksTooltip()),cur.paymentsOptions.boxTab=t,"link"===t?((0,i.hide)("payments_money_transfer_request_box"),show("payments_money_link_box"),D.hideMoneyLinksTooltip(),D.genQRCode(),D.showMoneyLinksTooltip()):(val("payments_money_transfer_summary",cur.paymentsOptions.boxSections[t].summary),val("payments_money_transfer_send",cur.paymentsOptions.boxSections[t].btn),val("payments_money_transfer_user_select_label",cur.paymentsOptions.boxSections[t].user_select_label),D.checkAmount(val("transfer_amount"),!1,!0),"transfer"===t&&D.updateCardFee(!0)),toggle("payments_money_transfer_nf_warning","transfer"===t),toggle("payments_money_transfer_methods","transfer"===t),toggle("payments_money_transfer_vk_pay_offer","transfer"===t),D.renderSelectBox(),setTimeout(i.elfocus.pbind("transfer_amount"),100))},genQRCode(){var e=ge("payments_money_transfer_qr");if(!e.childNodes.length){val(e,_.createQR(cur.paymentsOptions.transferLink,115,"qr-code",{isShowLogo:!0,isShowBackground:!1,foregroundColor:"var(--text_primary)",logoColor:"var(--accent)"}))}},shareQRCode(){D.hideMoneyLinksTooltip(!0),showBox("like.php",{act:"publish_box",object:"moneysend"+vk.id+"_0",list:""})},downloadQRCode(){if(!cur.paymentsOptions.qrUrl)return!1;var e=(0,i.ce)("iframe",{src:cur.paymentsOptions.qrUrl});return utilsNode.appendChild(e),cur.qrFrame&&(0,i.re)(cur.qrFrame),cur.qrFrame=e,!1},hideLinkCopied(){(0,c.each)((0,i.geByClass)("_link_copied","payments_money_link_box"),i.hide.pbind(this))},copyLinkToClipboard(e){D.hideLinkCopied(),D.hideMoneyLinksTooltip(!0),e.select(),document.execCommand("copy");var t=geByClass1("_link_copied",gpeByClass("_link_wrap",e));show(t)},renderSelectBox(){if(cur.uiTransferTo){var e="transfer"===cur.paymentsOptions.boxTab;cur.uiTransferTo.setData([]),cur.uiTransferTo.setOptions({autocomplete:!1}),cur.uiTransferTo.setData(cur.paymentsOptions.friends.filter((function(t){return e||!0===t[7]}))),cur.uiTransferTo.setOptions({autocomplete:!0}),cur.paymentsOptions.toId=null,cur.paymentsOptions.hash=null,cur.uiTransferTo.clear(),cur.uiTransferTo.deselectTokens(),val("payments_money_transfer_methods","")}},updateImHistory(e,t,n){var r=geByClass1("_money_transfer"+t,e);if(r){var o=geByClass1("_accept_btn",r);o&&((0,i.re)(geByClass1("_decline_btn",(0,i.domPN)(o))),domReplaceEl(o,n))}},initHistoryBox(e,t,n,o){var a=ge("ui_money_transfer_load_more");if(a){var s=ge("settings_transfer_history").tBodies[0];cur.userAutoScroll=new h.default(s,{offset:n,onNoMore:i.re.pbind(a),onNeedRows:(n,r)=>{var i={act:"money_transfer_history_box",offset:r,owner_id:e};t&&(i.request_id=t),o&&(i.hash=o),ajax.post("al_payments.php",i,{onDone:n})},drawRows:(e,t)=>{if(browser.msie){var n=(0,i.se)("<table>"+t+"</table>");for(var r in t=geByTag("tr",n))1==t[r].nodeType&&e.appendChild(t[r])}else e.insertAdjacentHTML("beforeEnd",t)},showProgress:r.lockButton.pbind(a),hideProgress:r.unlockButton.pbind(a),rowClass:"settings_history_row"})}},historyBox(){showBox("al_payments.php?act=money_transfer_history_box")},showMoneyLinksTooltip(){var e,t,n;cur.paymentsOptions.moneylinks_feature_tooltip&&!cur.moneyLinksTooltip&&((0,i.isVisible)("payments_money_link_box")?(e=geByClass1("payments_money_transfer_link_copy_btn","payments_money_link_box"),t=(0,d.getLang)("payments_money_link_btn_feature_text"),n={forceSide:"right",width:320,offset:[6,0]}):(e=geByClass1("ui_tab",geByClass1("_moneylink_tab","box_layer")))&&(t=(0,d.getLang)("payments_money_link_tab_feature_text"),n={forceSide:"bottom",width:250,offset:[0,4]}),e&&setTimeout((function(){cur.moneyLinksTooltip=new ElementTooltip(e,extend({content:'<div class="feature_tooltip__close" onclick="cur.moneyLinksTooltip.hide();"></div>'+t,cls:"feature_intro_tt feature_info_tooltip moneylinks_feature_tooltip",autoShow:!1,noHideOnClick:!0,noAutoHideOnWindowClick:!0,appendTo:geByClass1("ui_tabs","box_layer"),onHide:D.hideMoneyLinksTooltip.pbind(!0)},n)),cur.moneyLinksTooltip.show(),cur.destroy.push(D.hideMoneyLinksTooltip)}),500))},hideMoneyLinksTooltip(e){e&&ajax.post("al_index.php",{act:"hide_feature_tt",hash:cur.paymentsOptions.moneylinks_feature_tooltip_hash,type:"moneylinks"}),cur.moneyLinksTooltip&&(cur.moneyLinksTooltip.destroy(),delete cur.moneyLinksTooltip)},showPinBox(){(0,i.addClass)(curBox().bodyNode,"payments_box_code_showed"),show("payments_money_transfer_layer_bg","payments_money_transfer_code_box"),(0,c.each)((0,i.geByClass)("_code","payments_money_transfer_code_wrap"),(function(){val(this,"")})),(0,i.elfocus)("payments_code1"),curBox().changed=!0;var e=document.getElementById("payments_money_transfer_send");e&&(e.style.pointerEvents="none",setTimeout((()=>{e.style.pointerEvents="auto"}),0))},hidePinBox(){(0,i.hide)("payments_money_transfer_layer_bg","payments_money_transfer_code_box"),(0,i.removeClass)(curBox().bodyNode,"payments_box_code_showed"),curBox().changed=!1},checkVkPayOfferBox(){var e="payments_money_transfer_vk_pay_offer_box",t=!(0,r.isChecked)(e);(0,r.disableButton)("payments_money_transfer_send",!t),(0,r.checkbox)(e)},onPinKeyUp(e){var t=e.target;if(8==e.keyCode){var n=domPS(t);if(n){var r=n.getAttribute("data-index");val(n,""),cur.paymentsOptions.vkpcode[r]="",cur.paymentsOptions.vkpcode[r-1]="",(0,i.elfocus)(n)}}},onPinEnter(e){var t=e.target;if(!(e.keyCode>=47&&e.keyCode<=57))return cancelEvent(e);var n=t.getAttribute("data-index");cur.paymentsOptions.vkpcode||(cur.paymentsOptions.vkpcode=[]),cur.paymentsOptions.vkpcode[n-1]=e.key,val(t,String.fromCharCode(9679));var r=domNS(t);r?setTimeout(i.elfocus.pbind(r),10):setTimeout((function(){t.blur(),D.checkPin()}),10)},onPinClick(e){var t=e.target,n=domPS(t);if(n&&!val(n))return cancelEvent(e)},checkPin(){var e=cur.paymentsOptions.vkpcode.join("");delete cur.paymentsOptions.vkpcode,val("payments_money_transfer_code_error",""),ajax.post("al_payments.php?act=a_check_vkpay_pin",{code:e,hash:cur.paymentsOptions.pinHash},{onDone:t=>{if(1==t)return(0,i.hide)(geByClass1("_code_enter","payments_money_transfer_code_box")),void show(geByClass1("_code_recover","payments_money_transfer_code_box"));D.hidePinBox(),D.send(!1,e)},onFail:e=>(e&&val("payments_money_transfer_code_error",e),(0,c.each)((0,i.geByClass)("_code","payments_money_transfer_code_wrap"),(function(){val(this,""),(0,r.notaBene)(this)})),(0,i.elfocus)("payments_code1"),!0),showProgress:function(){(0,i.hide)("payments_money_transfer_code_wrap"),show("payments_money_transfer_spinner")},hideProgress:function(){(0,i.hide)("payments_money_transfer_spinner"),show("payments_money_transfer_code_wrap")}})},onReceiveMethodChange(e,t,n){(0,r.radiobtn)(e,t,n),D.updateTransferType(e),D.updateCardFee(!0)},updateTransferType(e){void 0!==cur.paymentsOptions.forceType?cur.paymentsOptions.transferType=cur.paymentsOptions.forceType:parseInt(cur.uiTransferCard.val())===T?cur.paymentsOptions.transferType=S:cur.paymentsOptions.onlyCards?cur.paymentsOptions.transferType=0:(void 0===e&&(0,c.each)(radioBtns.receiveOptions.els,(function(){hasClass(this,"on")&&(e=this)})),void 0!==e&&(cur.paymentsOptions.transferType=intval(attr(e,"data-type")))),D.checkAmount(val("transfer_amount"),!1,!0)},updateCardFee(e){if(cur.uiTransferCard&&"request"!==cur.paymentsOptions.boxTab){var t=intval(val("transfer_amount")),n=D.getTransferLimit("minAmount"),r=ge("payments_money_transfer_to_card"),o=cur.uiTransferCard.val(),a=cur.paymentsOptions.cardsFee[o],s=0===cur.paymentsOptions.transferType,c=parseInt(o)===T||cur.paymentsOptions.forceType===C||cur.paymentsOptions.forceType===S,l=parseInt(o)!==T&&!cur.paymentsOptions.receiverVkpay||0===cur.paymentsOptions.forceType,u=(0,d.getLang)("payments_transfer_without_fee"),_=(0,d.getLang)("payments_money_transfer_btn"),p=c?"payments_money_transfer_to_vkpay":"payments_money_transfer_to_card",h=l,f=0;if((0,i.toggleClass)(r,"disabled",c),(0,i.toggleClass)("payments_money_transfer_to_vkpay","disabled",l),0===parseInt(o))s&&(u=cur.paymentsOptions.mastercardPromoEnabled?(0,d.getLang)("payments_transfer_method_without_fee_for_mastercard"):(0,d.getLang)("payments_money_transfer_commission_undefined"));else if(parseInt(o)===T)h=!0;else if(s&&a&&(a.percent||a.vkPay&&a.vkPay.percent)){var m=a.free_amount_rest||0,g=a.free_amount_min||0;if(!m||t>m||g&&t<g){var v=t;t>m&&(v=t-m);var y=a.percent||0,E=a.min||0,w=a.add||0;(f=v*y)<E?f=E:f+=w,f=+(Math.round(f+"e+3")+"e-3"),f=+(Math.round(f+"e+2")+"e-2"),u=langNumeric(f,cur.paymentsOptions.cardsFeeStr,!0)}if(a.vkPay){var b=t+f,P=a.vkPay.percent||0,A=a.vkPay.min||0,k=a.vkPay.add||0,I=b*P;I<A?I=A:I+=k,f=+(Math.round(f+I+"e+2")+"e-2"),I=+(Math.round(I+"e+2")+"e-2"),u=langNumeric(f,cur.paymentsOptions.cardsFeeStr,!0),u+=langNumeric(I,cur.paymentsOptions.cardsFeeVkPayStr,!0)}}!p||e&&!h||ge(p).classList.contains("on")||ge(p).click(),t>=n&&!hasClass("payments_money_transfer_amount_wrap","money_error")&&(val("payments_money_transfer_notice",u),0===parseInt(o)&&s||(_=langNumeric(+(Math.round(t+f+"e+2")+"e-2"),cur.paymentsOptions.buttonAmountStr,!0))),val("payments_money_transfer_send",_)}},isVKPayFillUpEnabled:()=>1==cur.paymentsOptions.vkpayFillUpEnabled,isVKPayTransfer:()=>parseInt(cur.paymentsOptions.transferType)===S,getBindCards:()=>cur.paymentsOptions.cards.filter((e=>{var t=parseInt(e[0]);return 0!==t&&t!==T})),hideFillUpCardSelection(){(0,i.hide)("payments_money_transfer_fill_up_cards")},showFillUpCardSelection(){show("payments_money_transfer_fill_up_cards")},isFillUpCardSelectionVisible:()=>(0,i.isVisible)("payments_money_transfer_fill_up_cards")}},40774:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{PaymentsBox:()=>PaymentsBox});var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(66108),core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(96253),core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(21466),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(59357),_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(15544),_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(86125),_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(86409),_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(95724),_web_lib_message_box__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(54612),_web_lib_tooltip_utils__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(76852),_web_lib_lang__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(86067),_shared_lib_browser__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(26271),_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(79957),_web_lib_feature_entries__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(50167),_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(87481),_web_lib_ui_util__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(59121),_web_lib_accessibility__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(76270),_web_lib_utils__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(82452),_web_payments_app_order_box__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(91587),_shared_evbus__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(82804),_icons_desktop_getIcon24BrowserBack__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(39026),_shared_lib_site__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(61540);class PaymentsBox{static initHandlers(){(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/ps_promo_banner_click",(e=>{(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments_ps_promo_banner_event","","votes_buypage","relocate"),PaymentsBox.getVotesAmounts(!1,"spasibo",e.payload.target)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/save_phone_prefix_click",(e=>{(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)(geByTag1("input",e.payload.target.parentNode),0,0)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/save_phone_input",(e=>{13===e.payload.event.keyCode&&PaymentsBox.saveSmsPhone()})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/get_votes_amounts",(e=>{PaymentsBox.getVotesAmounts(!1,e.payload.dataAttrs.name,e.payload.target)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/phone_code_input",(e=>{13===e.payload.event.keyCode&&PaymentsBox.smsSendCode()})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_confirm_on_enter",(e=>{13===e.payload.event.keyCode&&PaymentsBox.showConfirm()})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_confirm",(()=>{PaymentsBox.showConfirm()})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_types",(()=>{PaymentsBox.showTypes()})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_terminal_tt",(e=>{PaymentsBox.paymentsShowTerminalTT(e.payload.target,e.payload.dataAttrs.name)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_phone_form",(()=>{PaymentsBox.showPhoneForm(2)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_phone_form_1",(()=>{PaymentsBox.showPhoneForm(1)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/show_all_prices",(e=>{PaymentsBox.showAllPrices(e.payload.target)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/change_option",(e=>{var t=e.payload.dataAttrs,n=t.index,r=t.name;PaymentsBox.onChangeOption(e.payload.target,n,r)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/focus_votes",(()=>{PaymentsBox.onChangeOption(geByClass1("last","payments_getvotes_amounts"),4,"payments_getvotes_amounts")})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/update_pay_amount",(e=>{PaymentsBox.updatePayAmount(e.payload.target)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/make_checkbox",(e=>{(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.checkbox)(e.payload.target)})),(0,_shared_evbus__WEBPACK_IMPORTED_MODULE_19__.tq)().setInteractiveHandler("PaymentsBox/toggle_email",(e=>{PaymentsBox.toggleEmail(e.payload.target)}))}static initialize(e){PaymentsBox.initHandlers(),window.curNotifier&&curNotifier.idle_manager&&curNotifier.idle_manager.started&&(isArray(cur.onUnidle)||(cur.onUnidle=[]),isArray(cur.onIdle)||(cur.onIdle=[]),cur.onUnidle.push((()=>{cur.getVotesDoneHide=!0})),cur.onIdle.push((()=>{cur.getVotesDoneHide=!1})));var t={bodyStyle:"padding: 0;",hideButtons:!0};if(cur.paymentsWideBox){var n={width:cur.checkoutEnabled?800:780,height:390};cur.checkoutEnabled||(n.title=!1),t=extend(t,n)}else t=extend(t,{width:480});if(e.setOptions(extend(t,{onClean:()=>{var t="sms"===cur.votesType&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress");for(var n in cur.smsChkStatInt&&clearInterval(cur.smsChkStatInt),cur.paymentsWaitingCache)cur.paymentsWaitingCache[n][2]&&clearInterval(cur.paymentsWaitingCache[n][2]);cur.smsAmountsInt&&clearTimeout(cur.smsAmountsInt),cur.isPaymentsAppOrder&&(cur.isPaymentComplete||cur.isPaymentAttemted)?e.onDone?e.onDone():(e.hide(),_web_payments_app_order_box__WEBPACK_IMPORTED_MODULE_18__.AppOrderBox.processOrder(1,e)):cur.isPaymentsAppOrder&&!cur.paymentsCheckOrderCnt&&cur.paymentsOrderBillPeriod&&cur.onSubscriptionCancel?cur.onSubscriptionCancel():cur.isPaymentsAppOrder&&!cur.paymentsCheckOrderCnt&&cur.onAppOrderCancel?cur.onAppOrderCancel():cur.paymentsTryCompleteOrder&&(cur.isPaymentComplete||cur.isPaymentAttemted)&&e.onDone&&e.onDone(),PaymentsBox.removeCheckOffersEvent(),window.removeEventListener("message",PaymentsBox.frameMessage,!1),window.removeEventListener("message",PaymentsBox.handlePaymentCompleteMessage,!1),t&&(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.showDoneBox)(getLang("payments_get_votes_box_close_notice"),{out:6e3})}})),(cur.fromInstantPay||cur.paymentsAuthPayment)&&(e.onDone=!1),cur.votesBox=e,cur.destroy.push((()=>{for(;boxQueue.count();)boxQueue.hideLast(!1)})),cur.checkoutEnabled)if(cur.paymentsWideBox){PaymentsBox.showProgress(""),PaymentsBox.submitDmrCheckout(cur.paymentsPreferVotes,!0);var r=ge("payments_wide_box_close_btn");r&&(r.onclick=cur.votesBox.hide)}else show("payments_getvotes_cont"),window.radioBtns.payments_getvotes_amounts={els:Array.prototype.slice.apply((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("radiobtn",ge("payments_getvotes_amounts")))},PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm);else cur.votesTypeInit&&(PaymentsBox.getVotesAmounts(!1,cur.votesTypeInit),cur.votesTypeInit=!1)}static initPhoneCountry(e,t){cur.countries=e,cur.defCountry=t,cur.uiPhoneCountry=new Dropdown(ge("phone_country"),cur.countries,{selectedItems:t,big:!0,autocomplete:!0,multiselect:!1,onChange:e=>{var t=ge("phone"),n=ge("payments_phone_prefix"),r=cur.uiPhoneCountry.val_full()[3];if(0===e||"0"===e||""===e||!1===e||void 0===e){var o=val(n);if(r==o)return;for(var i=0,a=cur.countries.length;i<a;++i)if(cur.countries[i][3]==o)return cur.uiPhoneCountry.val(cur.countries[i]);return cur.uiPhoneCountry.val(cur.defCountry,!0)}val(n,r),setTimeout(_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus.pbind(t),0)}}),cur.destroy.push(cur.uiPhoneCountry.destroy.bind(cur.uiPhoneCountry))}static initPhoneNumber(e){e&&["input","keydown","keyup","mousedown","mouseup","select","contextmenu","drop"].forEach((function(t){e.addEventListener(t,(e=>{var t=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.domClosestByTag)("input",e.target);t&&(t.value=t.value.replace(/\D/g,""))}))}))}static validateEmail(e){return e.length<64&&e.match(/^.{1,40}@.{1,40}$/)&&e.match(/^([a-z0-9_\-]{0,40}\.){0,10}[a-z0-9_\-*]{1,40}@(([a-z0-9][a-z0-9_\-]{0,40})?[a-z0-9]\.){1,6}[a-z]{2,7}$/i)}static getEmail(){var e=!1;if(cur.paymentsEmailCheckbox)if((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)(cur.paymentsEmailCheckbox)){if(!(e=(0,_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__.trim)(val(cur.paymentsEmailInput))))return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)(cur.paymentsEmailInput),""}else e="false";return e}static toggleEmail(e){"INPUT"===e.tagName&&(e=geByClass1("checkbox",(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(e)),(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)(e))||((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.checkbox)(e),(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)(e)&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)(cur.paymentsEmailInput))}static unbind(e,t,n,r){if(!(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")){var o=cur.paymentsPreferVotes;if(n){var i={act:"a_del_instant_method",type:e,prefer_votes:r?-1:o,hash:t};cur.isPaymentsAppOrder&&cur.paymentsOrderAppId&&(i.aid=cur.paymentsOrderAppId),ajax.post("al_payments.php",i,{onDone:PaymentsBox.getVotesAmountsOnDone,onFail:function(e){return PaymentsBox.showBoxError(e),!0},showProgress:()=>{cur.confirmBox?cur.confirmBox.showProgress():(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit")},hideProgress:()=>{cur.confirmBox?cur.confirmBox.hide():(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit")}})}else{var a="card"==e?getLang("payments_unbind_card_confirm"):getLang("payments_revoke_token_confirm");cur.confirmBox=(0,_web_lib_message_box__WEBPACK_IMPORTED_MODULE_8__.showFastBox)({title:getLang("global_action_confirmation"),dark:1,forceNoBtn:1,bodyStyle:"padding: 20px; line-height: 160%;"},a,getLang("payments_unbind_card_btn"),(()=>{PaymentsBox.unbind(e,t,!0)}),getLang("global_cancel"))}}}static instantPay(){if(!(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")){var e=(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)();if(cur.isPaymentAttemted=!0,cur.paymentsAuthPayment)e.hide();else{var t,n,r;if(ge("payments_getvotes_amounts")&&(cur.votesAmountsVal=(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.radioval)("payments_getvotes_amounts")),void 0===cur.votesAmountsData[cur.votesAmountsVal]){var o=ge("votes_num")?parseInt(ge("votes_num").value,10):0;if(!(o>0))return;cur._otherVotes=o,t=cur._otherAmount,n=cur._otherAmount,r=cur.votesAmountCustomTimeHash}else t=cur.votesAmountsData[cur.votesAmountsVal][2],n=cur.votesAmountsData[cur.votesAmountsVal][3],r=cur.votesAmountsData[cur.votesAmountsVal][4];var i={act:"a_getvotes_charge",type:cur.votesType,instant_pay:1,amount:t,order_amount:n,hash:r};cur.statSessionId&&(i.stat_session_id=cur.statSessionId),cur.isPaymentsAppOrder&&cur.paymentsOrderId&&(i.order_id=cur.paymentsOrderId,i.order_app_id=cur.paymentsOrderAppId,i.order_bill_period=cur.paymentsOrderBillPeriod,i.order_hash=cur.paymentsOrderHash),PaymentsBox.disablePaymentTypesRows(),ajax.post("al_payments.php",i,{onDone:(e,t)=>{cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((()=>{PaymentsBox.checkStatus(cur.votesType,e)}),2e3),PaymentsBox.showProgress&&PaymentsBox.showProgress()},onFail:e=>(PaymentsBox.showBoxError(e),!0),showProgress:_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton.pbind("payments_getvotes_submit"),hideProgress:_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton.pbind("payments_getvotes_submit")})}}}static showAllPrices(e){return each((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("radiobtn",ge("payments_getvotes_amounts")),((e,t)=>{show(t)})),(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.re)(e),!1}static paymentsShowTerminalTT(e,t){var n="";cur.paymentsTooltips[t]&&(n+=cur.paymentsTooltips[t]),n&&(0,_web_lib_tooltip_utils__WEBPACK_IMPORTED_MODULE_9__.showTooltip)(e,{text:n,dir:"auto",slide:15,className:"payments_terminal_tt",shift:[-3,3],hasover:1})}static updatePayAmount(o){var v=o.value.replace(/[^0-9]/g,""),i=(0,_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__.intval)(parseInt(v,10));v=i<1e4?i:parseInt(i.toString().substr(0,4),10),o.value!=v&&(o.value=v);var amount=0;if(cur.votesAmountsData.calcPayAmount){-1==cur.votesAmountsData.calcPayAmount.indexOf("return")&&(cur.votesAmountsData.calcPayAmount="return "+cur.votesAmountsData.calcPayAmount);var calcFunc="(function(votes){"+cur.votesAmountsData.calcPayAmount+";})("+v+")";try{amount=eval(calcFunc)}catch(e){(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.logEvalError)(e,calcFunc)}amount=amount?Math.ceil(100*amount)/100:0,amount=parseInt(amount,10)==amount?amount.toFixed(0):amount.toFixed(2),cur._otherAmount=amount,cur._otherVotes=v}var bonusElement=ge("payments_other_votes_bonus");if(bonusElement&&(cur.votesAmountsData.bonusesTable||cur.votesAmountsData.calcBonusVotes)){var bonus=0;if(cur.votesAmountsData.calcBonusVotes){var _calcFunc="(function(votes){"+cur.votesAmountsData.calcBonusVotes+";})("+v+")";try{bonus=eval(_calcFunc)}catch(e){(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.logEvalError)(e,_calcFunc)}}else for(var j in cur.votesAmountsData.bonusesTable)if(v>=j){var _bonus=Math.floor(v*cur.votesAmountsData.bonusesTable[j]/j);_bonus>bonus&&(bonus=_bonus)}bonus?(bonusElement.innerHTML=getLang("payments_bonus_votes",bonus),show(bonusElement)):hide(bonusElement)}cur.votesAmountsData.currency_str?ge("votes_amount").innerHTML=amount>0?(0,_web_lib_lang__WEBPACK_IMPORTED_MODULE_10__.langNumeric)(amount,cur.votesAmountsData.currency_str):"":ge("votes_amount").innerHTML=amount>0?getLang("payments_votes_cost_in_rubles",amount):""}static onChangeOption(e,t,n){var r;if((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.radiobtn)(e,t,n),"payments_getvotes_amounts"===n){var o=cur.votesAmountsData[t];o?(cur.votesAmountsVal=t,r=getLang("payments_get_votes_for_X").replace("{amount}",o[1]),val("votes_num",""),val("votes_amount",""),cur.paymentsEmailCheckbox&&(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)(cur.paymentsEmailCheckbox)&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)(cur.paymentsEmailInput)):(r=cur.payments_get_votes,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)("votes_num")),cur.checkoutEnabled?PaymentsBox.setButtons(r,PaymentsBox.showConfirm):PaymentsBox.setButtons(r,cur.votesAmountIsInstant||o&&o.length>=5?PaymentsBox.instantPay:PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes)}}static setConfirmButtons(){if("card"!=cur.votesType&&cur.psList[cur.votesType]){var e=cur.paymentsWideBox?getLang("payments_back_to_ps_list"):getLang("payments_go_ps_list"),t=!cur.psList[cur.votesType].in_menu;cur.paymentsInstantPayType==cur.votesType?t?PaymentsBox.setButtons(getLang("payments_pay_order_btn"),PaymentsBox.instantPay,e,PaymentsBox.showPaySystemsList):PaymentsBox.setButtons(getLang("payments_pay_order_btn"),PaymentsBox.instantPay):t?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm,e,PaymentsBox.showPaySystemsList):PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm)}else cur.checkoutEnabled?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm):PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes)}static popupWrite(e){return!(e.document.innerHTML==cur._popup_text||!cur._popup_text)&&(e.document.write(cur._popup_text),e.document.close(),e.blur(),e.focus(),cur._popup_callback&&cur._popup_callback(),!0)}static show3DsFrame(e,t){if(cur.threeds_submitted)return!0;cur.threeds_submitted=!0;var n=ge("payments_iframe_container"),r=ge("cards_iframe");r||((r=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("iframe",{id:"card_iframe",name:"card_iframe"},{border:0,height:"435px",width:n.parentNode.offsetWidth+"px",overflowX:"hidden",overflowY:"hidden"})).frameBorder=0,n.innerHTML="",n.appendChild(r));var o=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("form",{target:"card_iframe",method:"POST",action:e});for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&o.appendChild((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("input",{type:"hidden",name:i,value:t[i]}));n.appendChild(o),addClass("payments_iframe_container",cur.checkoutEnabled?"payments_threeds_checkout_frame":"payments_threeds_frame"),show("payments_iframe_container"),hide("payments_box_progress"),o.submit()}static submitDmrCheckout(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")||t){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit");var n=cur.psList.dmr_checkout,r=!1,o=(e*n.vote_cost).toFixed(2);if(!e||e<=0?r=getLang("payments_web_no_sum"):n.min_amount&&e<n.min_amount?r=getLang("payments_min_amount_limit_votes").replace("%s",n.min_amount):n.max_amount&&e>n.max_amount?r=getLang("payments_max_amount_limit_votes").replace("%s",n.max_amount):void 0!==n.rest_amount_day&&e>n.rest_amount_day?r=getLang("payments_rest_amount_day_votes").replace("%s",n.rest_amount_day):void 0!==n.rest_amount_week&&e>n.rest_amount_week&&(r=getLang("payments_rest_amount_week_votes").replace("%s",n.rest_amount_week)),r)return PaymentsBox.showBoxError(r),!1;var i=PaymentsBox.getEmail();if(""===i)return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),!1;if(i&&"false"!==i&&!PaymentsBox.validateEmail(i))return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)(cur.paymentsEmailInput),PaymentsBox.showBoxError(getLang("payments_error_invalid_email")),!1;removeClass("payments_iframe_container","payments_threeds_checkout_frame");var a=ge("payments_iframe_container"),s=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("iframe",{id:"card_iframe",name:"card_iframe"},{border:0,height:"435px",width:a.parentNode.offsetWidth+"px",overflowX:"hidden",overflowY:"hidden",display:"block",borderRadius:"0 0 4px 4px"});s.frameBorder=0,a.innerHTML="",a.style.height=s.style.height,a.appendChild(s),window.addEventListener("message",PaymentsBox.frameMessage,!1);var c=cur.votesType;!c&&cur.votesTypeInit&&(c=cur.votesTypeInit);var l={act:"a_getvotes_charge",type:"dmr_checkout",hash:cur.paymentsHash,amount:o,stat_session_id:cur.statSessionId,votes:e};c&&(l.pay_method=c),cur.paymentsAuthPayment&&(l.only_auth=1),i&&(l.email=i),cur.votesAmountsData.appoveCode&&(l.approve_code=cur.votesAmountsData.appoveCode),cur.isPaymentsAppOrder&&cur.paymentsOrderId&&(l.order_id=cur.paymentsOrderId,l.order_app_id=cur.paymentsOrderAppId,l.order_bill_period=cur.paymentsOrderBillPeriod,l.order_hash=cur.paymentsOrderHash),cur.votesAmountsData.purchaseDescr&&(l.purchase_descr=cur.votesAmountsData.purchaseDescr),PaymentsBox.trackingProtectionEnabled((function(){(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr_checkout","iframe_track_protection_enabled")}),(function(){(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr_checkout","iframe_track_protection_disabled")})),ajax.post("al_payments.php",l,{onDone:function(t,r,i){if(t){if(-2==t){var a=getLang("global_money_amount_rub",Math.floor(o));return val("payments_getvotes_confirm_msg",r),val("payments_box_votes_num",e),val("payments_box_amount",a),val("payments_box_votes_money",getLang("payments_money_for_votes",e).replace("{money}",a)),cur.votesAmountsData.resend_msg&&val("payments_getvotes_sms_resend",cur.votesAmountsData.resend_msg),cur.votesAmountsData.confirm_hash=i,val("confcode",""),show("payments_box_confcode_wrap"),PaymentsBox.enablePaymentTypesRows(),void PaymentsBox.approveGetCode()}if((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")&&PaymentsBox.showVotesAmounts(),!cur.paymentsWideBox){var s=ge("payments_getvotes_submit");PaymentsBox.setButtons(s.innerHTML,PaymentsBox.showConfirm,getLang("global_back"),PaymentsBox.showVotesAmounts)}cur._popup_text=r,cur._popup_callback=!1,cur._popup_callback=function(){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),hide("payments_getvotes_wrap","payments_getvotes_buttons","payments_box_progress","payments_box_error"),show("payments_iframe_container"),ge("payments_iframe_container").scrollTop=0};var c=ge("card_iframe");c.contentWindow.document.open("text/html","replace"),c.contentWindow.document.write(r),c.contentWindow.document.close(),cur._popup_callback(),cur.smsChkData=t,cur.isPaymentComplete=cur.isPaymentCanceled=cur.isPaymentFailed=!1,cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((function(){PaymentsBox.checkStatus("dmr_checkout",t),n.use_iframe&&(cur.isPaymentCanceled||cur.isPaymentFailed)?(clearInterval(cur.smsChkStatInt),PaymentsBox.showVotesAmounts(),cur.isPaymentFailed?PaymentsBox.showBoxError(getLang("payments_landing_cancelled")):PaymentsBox.showBoxError(getLang("payments_payment_cancelled")),window.removeEventListener("message",PaymentsBox.frameMessage,!1)):cur.isPaymentComplete&&"dmr_checkout"!=n.name&&PaymentsBox.showTypes()}),2e3)}},onFail:e=>((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")||PaymentsBox.setConfirmButtons(),PaymentsBox.showBoxError(e),!0),frame:_shared_lib_browser__WEBPACK_IMPORTED_MODULE_11__.browser.safari_mobile})}}static submitCard(e){if(!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit");var t=cur.psList.card,n=!1,r=(e*t.vote_cost).toFixed(2);if(!e||e<=0?n=getLang("payments_web_no_sum"):t.min_amount&&e<t.min_amount?n=getLang("payments_min_amount_limit_votes").replace("%s",t.min_amount):t.max_amount&&e>t.max_amount?n=getLang("payments_max_amount_limit_votes").replace("%s",t.max_amount):null!=t.rest_amount_day&&e>t.rest_amount_day?n=getLang("payments_rest_amount_day_votes").replace("%s",t.rest_amount_day):null!=t.rest_amount_week&&e>t.rest_amount_week&&(n=getLang("payments_rest_amount_week_votes").replace("%s",t.rest_amount_week)),n)return PaymentsBox.showBoxError(n),!1;var o,i=PaymentsBox.getEmail();if(""===i)return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),!1;if(i&&"false"!==i&&!PaymentsBox.validateEmail(i))return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)(cur.paymentsEmailInput),PaymentsBox.showBoxError(getLang("payments_error_invalid_email")),!1;if(cur.votesAmountsData.needApprove){var a=getLang("global_money_amount_rub",Math.floor(r));return val("payments_getvotes_confirm_msg",cur.votesAmountsData.needApprove),val("payments_box_votes_num",e),val("payments_box_amount",a),val("payments_box_votes_money",getLang("payments_money_for_votes",e).replace("{money}",a)),cur.votesAmountsData.resend_msg&&val("payments_getvotes_sms_resend",cur.votesAmountsData.resend_msg),val("confcode",""),delete cur.votesAmountsData.needApprove,show("payments_box_confcode_wrap"),void PaymentsBox.approveGetCode()}if(PaymentsBox.disablePaymentTypesRows(),t.use_iframe){var s=ge("payments_iframe_container"),c=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("iframe",{id:"card_iframe",name:"card_iframe"},{border:0,height:"435px",width:s.parentNode.offsetWidth+"px",overflowX:"hidden",overflowY:"hidden"});c.frameBorder=0,s.innerHTML="",s.appendChild(c),window.addEventListener("message",PaymentsBox.frameMessage,!1)}else{o=window.open("","_blank","scrollbars=1, resizable=1, menubar=1, left=0, top=0, toolbar=1, status=1"),cur._popup_text=PaymentsBox.popupHtml(getLang("payments_cards_redirect"),"",""),PaymentsBox.popupWrite(o)}var l={act:"a_getvotes_charge",type:"card",hash:cur.paymentsHash,amount:r,stat_session_id:cur.statSessionId};cur.paymentsAuthPayment&&(l.only_auth=1),i&&(l.email=i),cur.votesAmountsData.appoveCode&&(l.approve_code=cur.votesAmountsData.appoveCode),cur.isPaymentsAppOrder&&cur.paymentsOrderId&&(l.order_id=cur.paymentsOrderId,l.order_app_id=cur.paymentsOrderAppId,l.order_bill_period=cur.paymentsOrderBillPeriod,l.order_hash=cur.paymentsOrderHash),PaymentsBox.trackingProtectionEnabled((function(){(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr","iframe_track_protection_enabled")}),(function(){(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr","iframe_track_protection_disabled")})),ajax.post("al_payments.php",l,{onDone:function(n,i,a){if(n){if(-2==n){t.use_iframe||o.close();var s=getLang("global_money_amount_rub",Math.floor(r));return val("payments_getvotes_confirm_msg",i),val("payments_box_votes_num",e),val("payments_box_amount",s),val("payments_box_votes_money",getLang("payments_money_for_votes",e).replace("{money}",s)),cur.votesAmountsData.resend_msg&&val("payments_getvotes_sms_resend",cur.votesAmountsData.resend_msg),cur.votesAmountsData.confirm_hash=a,val("confcode",""),show("payments_box_confcode_wrap"),PaymentsBox.enablePaymentTypesRows(),void PaymentsBox.approveGetCode()}if((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")&&PaymentsBox.showVotesAmounts(),t.use_iframe||((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),PaymentsBox.showProgress()),cur._popup_text=i,cur._popup_callback=!1,t.use_iframe){cur._popup_callback=function(){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),hide("payments_getvotes_wrap","payments_getvotes_buttons","payments_box_progress","payments_box_error"),show("payments_iframe_container"),ge("payments_iframe_container").scrollTop=0};var c=ge("card_iframe");c.contentWindow.document.open("text/html","replace"),c.contentWindow.document.write(i),c.contentWindow.document.close(),cur._popup_callback()}else o.document.open("text/html","replace"),o.document.write(i),o.document.close(),o.blur(),o.focus();cur.smsChkData=n,cur.isPaymentComplete=cur.isPaymentCanceled=cur.isPaymentFailed=!1,cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((function(){PaymentsBox.checkStatus("card",n),!t.use_iframe&&o.closed?setTimeout((function(){cur.isPaymentComplete||(clearInterval(cur.smsChkStatInt),PaymentsBox.showBoxError(getLang("payments_payment_cancelled"),"info_msg"),PaymentsBox.setConfirmButtons())}),500):t.use_iframe&&(cur.isPaymentCanceled||cur.isPaymentFailed)?(clearInterval(cur.smsChkStatInt),PaymentsBox.showVotesAmounts(),cur.isPaymentFailed?PaymentsBox.showBoxError(getLang("payments_landing_cancelled")):PaymentsBox.showBoxError(getLang("payments_payment_cancelled")),window.removeEventListener("message",PaymentsBox.frameMessage,!1)):cur.isPaymentComplete&&"alfabank"!=t.name&&"dmr"!=t.name&&PaymentsBox.showTypes()}),2e3)}},onFail:function(e){return t.use_iframe||o.close(),(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")||PaymentsBox.setConfirmButtons(),PaymentsBox.showBoxError(e),!0},frame:_shared_lib_browser__WEBPACK_IMPORTED_MODULE_11__.browser.safari_mobile})}}static trackingProtectionEnabled(e,t){var n=new XMLHttpRequest;n.open("GET","https://top-fwz1.mail.ru/counter2?id=1",!0),n.onreadystatechange=function(){200!==n.status?e():t(),n.onreadystatechange=null},n.send()}static submitPaymentSystem(e){if(!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")){var t=cur.votesType,n=cur.psList[t],r=!1,o=0,i=0,a=0,s=0;if(!n.simple_redirect){if(!e)return;o=(e*n.vote_cost).toFixed(2),i=(e*n.vote_cost/cur.usdRate).toFixed(2),a=Math.floor(o),s=100*(o-a),!e||e<=0?r=getLang("payments_web_no_sum"):n.min_amount&&e<n.min_amount?r=getLang("payments_min_amount_limit_votes").replace("%s",n.min_amount):n.max_amount&&e>n.max_amount?r=getLang("payments_max_amount_limit_votes").replace("%s",n.max_amount):null!=n.rest_amount_day&&e>n.rest_amount_day?r=getLang("payments_rest_amount_day_votes").replace("%s",n.rest_amount_day):null!=n.rest_amount_week&&e>n.rest_amount_week&&(r=getLang("payments_rest_amount_week_votes").replace("%s",n.rest_amount_week))}if(r)return PaymentsBox.showBoxError(r),!1;var c=PaymentsBox.getEmail();if(""!==c)if(!c||"false"===c||PaymentsBox.validateEmail(c)){if(PaymentsBox.showProgress(),PaymentsBox.disablePaymentTypesRows(),"mailmoney_vkpay"===t){var l={act:"a_getvotes_charge",type:t,hash:cur.paymentsHash,amount:o,random_auth:0,stat_session_id:cur.statSessionId};ajax.post("al_payments.php",l,{onDone:e=>{var t=(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)(),n={noLocChange:1,skipBoxesHide:1,noClickHide:1};cur.isPaymentsAppOrder?cur.app.openAppInLayer(e,!1,!0,n):(0,_web_lib_feature_entries__WEBPACK_IMPORTED_MODULE_13__.showWiki)({w:e},!1,!1,n),t._hide(!1,!0),cur.onExternalAppDone=e=>{t._show(),e.status||(PaymentsBox.showBoxError(getLang("payments_payment_cancelled"),"info_msg"),PaymentsBox.setConfirmButtons(),clearInterval(cur.smsChkStatInt)),cur.onExternalAppDone=null,window.WkView&&WkView.hide(!1,!0)},cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((function(){PaymentsBox.checkStatus(cur.votesType,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.data,null,t)}),2e3)},onFail:e=>(PaymentsBox.showBoxError(e),PaymentsBox.setConfirmButtons(),!0)})}else{if(cur.votesAmountsData.oauth_url&&(!ge("payments_remember_wallet")||(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)("payments_remember_wallet"))){var u=cur.votesAmountsData.oauth_params,d="";for(var _ in u){if(Object.prototype.hasOwnProperty.call(u,_))d+=`<input type="hidden" autocomplete="off" name="${_}" value="${u[_]}"/>`}var p=ge("paymentSystemsForm");p.action=cur.votesAmountsData.oauth_url,p.method="post",p.innerHTML=d;var h=cur.votesAmountsData.popup_params||{},f=h.width||700,m=h.height||600,g=`scrollbars=1, resizable=1, menubar=0, left=${Math.floor(window.screen.width/2)-f/2}, top=${Math.floor(window.screen.height/2)-m/2}, width=${f}, height=${m}`,v=getLang("payment_redirect").replace("%s",n.title),y=`<form action="${p.action}" method="${p.method}" id="popup_payment_form" accept-charset="UTF-8">${p.innerHTML}</form>`;cur._popup_text=PaymentsBox.popupHtml(v,y,"document.getElementById('popup_payment_form').submit()"),cur._popup_callback=!1,window.addEventListener("message",PaymentsBox.handlePaymentCompleteMessage,!1);var E=window.open("","_blank",g);cur.smsChkStatCnt=0,cur.oauthState=0;var w=0;return cur.smsChkStatInt=setInterval((function(){if(2==cur.oauthState)PaymentsBox.checkStatus(cur.votesType,cur.smsChkData);else if(0==cur.oauthState&&(w=cur.isPaymentComplete&&cur.paymentCompleteParams&&cur.paymentCompleteParams.code?cur.paymentCompleteParams.code:0)){cur.oauthState=1;var e={act:"a_getvotes_charge",type:t,oauth_code:w,hash:cur.paymentsHash,amount:o,stat_session_id:cur.statSessionId};return cur.paymentsAuthPayment&&(e.only_auth=1),c&&(e.email=c),void ajax.post("al_payments.php",e,{onDone:e=>{cur.oauthState=2,cur.smsChkData=e},onFail:e=>(clearInterval(cur.smsChkStatInt),PaymentsBox.showBoxError(e),PaymentsBox.setConfirmButtons(),!0)})}(E.closed&&!cur.isPaymentComplete||cur.isPaymentComplete&&!w)&&(clearInterval(cur.smsChkStatInt),cur.isPaymentComplete?PaymentsBox.showBoxError(getLang("payments_sms_money_fail")):PaymentsBox.showBoxError(getLang("payments_payment_cancelled"),"info_msg"),PaymentsBox.setConfirmButtons())}),2e3),void PaymentsBox.popupWrite(E)}if(cur.votesAmountsData.provider&&-1!==["dmr","paypal","yandexmoney","api_provider"].indexOf(cur.votesAmountsData.provider)){var b,C=getLang("payment_redirect").replace("%s",n.title),S={act:"a_getvotes_charge",type:t,hash:cur.paymentsHash,amount:o,random_auth:0,stat_session_id:cur.statSessionId};if(c&&(S.email=c),"paypal"===cur.votesAmountsData.provider||"yandexmoney"===cur.votesAmountsData.provider){var T;if(ge("payments_remember_wallet")?(S.remember_wallet=(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)("payments_remember_wallet")||cur.forceRebind,cur.forceRebind&&(cur.forceRebind=!1)):S.remember_wallet=1,S.remember_wallet){var D=cur.votesAmountsData.popup_params||{},P=D.width||700,A=D.height||600;T=`scrollbars=1, resizable=1, menubar=0, left=${Math.floor(window.screen.width/2)-P/2}, top=${Math.floor(window.screen.height/2)-A/2}, width=${P}, height=${A}`}else{T="scrollbars=1, resizable=1, menubar=1, left=0, top=0, toolbar=1, status=1"}b=S.remember_wallet?window.open("","",T):window.open("","_blank",T);var k=getLang("payment_redirect").replace("%s",n.title);cur._popup_text=PaymentsBox.popupHtml(k,"",""),PaymentsBox.popupWrite(b)}ajax.post("al_payments.php",S,{onDone:function(e,t,n){if(e){var r="api_provider"!==cur.votesAmountsData.provider;cur.canOpenPopup=r;var o=!r;PaymentsBox.checkStatusCallback=e=>{if("paypal"===cur.votesAmountsData.provider||"yandexmoney"===cur.votesAmountsData.provider){if(b&&!b.closed&&!o){o=!0;var t=ge("paymentSystemsForm");t.action=e.action,t.method="get";var n="";for(var r in e.params){if(Object.prototype.hasOwnProperty.call(e.params,r))n+=`<input type="hidden" autocomplete="off" name="${r}" value="${e.params[r]}"/>`}t.innerHTML=n;var i=`<form action="${t.action}" method="${t.method}" id="popup_payment_form" accept-charset="UTF-8">${t.innerHTML}</form>`;cur._popup_text=PaymentsBox.popupHtml(C,i,"document.getElementById('popup_payment_form').submit()"),PaymentsBox.popupWrite(b)}(b.closed&&!cur.isPaymentComplete||cur.isPaymentComplete)&&(clearInterval(cur.smsChkStatInt),PaymentsBox.showBoxError(cur.isPaymentComplete?getLang("payments_sms_money_fail"):getLang("payments_payment_cancelled")),PaymentsBox.setConfirmButtons())}else cur._popup||(cur._popup=window.open("","_blank"))},cur.smsChkData=e,cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((()=>{PaymentsBox.checkStatus(cur.votesType,e)}),2e3)}},onFail:function(e){return(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")||PaymentsBox.setConfirmButtons(),PaymentsBox.showBoxError(e),!0}})}else{if(!cur.isAdsPayment){var I={act:"a_getvotes_invoice",type:cur.votesType,amount:o,votes:e,invoice_hash:cur.votesAmountsData.invoice_hash,stat_session_id:cur.statSessionId};ajax.post("al_payments.php",I)}var O=n.gate_params,x="",R=ge("paymentSystemsForm"),M=(new Date).getTime();for(var L in O)if(Object.prototype.hasOwnProperty.call(O,L)){var N=O[L];x+=`<input type="hidden" autocomplete="off" name="${L}" value="${N=(N=(N=(N=(N=(N=N.replace("{amount_votes}",e)).replace("{amount_rub}",o)).replace("{amount_usd}",i)).replace("{amount_rub_int}",a)).replace("{amount_rub_frac}",s)).replace("{time}",M)}"/>`}var B=n.gate_url;B=(B=(B=(B=(B=(B=B.replace("{time}",M)).replace("{amount_votes}",e)).replace("{amount_rub}",o)).replace("{amount_usd}",i)).replace("{amount_rub_int}",a)).replace("{amount_rub_frac}",s),R.action=B,R.method=n.gate_method,R.innerHTML=x;var U=!1;try{var F=getLang("payment_redirect").replace("%s",n.title),W=`<form action="${R.action}" method="${R.method}" id="popup_payment_form" accept-charset="${n.gate_charset}">${R.innerHTML}</form>`;cur._popup_text=PaymentsBox.popupHtml(F,W,`Payments.submitPopupForm("${t}", "${e}", "${o}", "${i}")`),cur._popup_callback=!1,U=window.open("","_blank","scrollbars=1, resizable=1, menubar=1, left=0, top=0, toolbar=1, status=1"),(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments","","votes",t,"start"),cur.smsChkData=!1,cur.isPaymentComplete=!1,cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval((function(){PaymentsBox.checkStatus(cur.votesType,!1),U.closed&&!cur.isPaymentComplete&&(clearInterval(cur.smsChkStatInt),PaymentsBox.showBoxError(getLang("payments_payment_cancelled"),"info_msg"),n.simple_redirect?PaymentsBox.setButtons(!1,!1,cur.paymentsChangeType,PaymentsBox.showTypes):PaymentsBox.setConfirmButtons())}),2e3),PaymentsBox.popupWrite(U)}catch(e){R.submit()}c&&ajax.post("al_payments.php",{act:"a_set_receipt_email",email:c,hash:cur.paymentsHash},{onFail:e=>!0})}}}else PaymentsBox.showBoxError(getLang("payments_error_invalid_email"))}}static approveSendCode(){var e=ge("confcode").value;if(e.length){hide("payments_box_error");for(var t=0,n=0;n<e.length;n++)t+=parseInt(e[n]);if((t%=10)!=cur.votesAmountsData.approveCodeChk)return PaymentsBox.showBoxError(getLang("payments_invalid_code")),void(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)("confcode");cur.votesAmountsData.appoveCode=e,PaymentsBox.showConfirm()}else(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)("confcode")}static approveGetCode(e){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit");var t={act:"a_getvotes_approve_code",hash:cur.votesAmountsData.confirm_hash};return e&&(t.resend=1),ajax.post("al_payments.php",t,{onDone:function(t,n){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),1==t?PaymentsBox.showBoxError(n):e||(cur.votesAmountsData.approveCodeChk=n,PaymentsBox.refreshBox(),show("payments_getvotes_confirm"),PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.approveSendCode,cur.paymentsChangeType,cur.checkoutEnabled?PaymentsBox.showVotesAmounts:PaymentsBox.showTypes))},onFail:function(e){return PaymentsBox.showBoxError(e),PaymentsBox.setConfirmButtons(),!0}}),!1}static smsSendPin(){if(null==cur.votesAmountsVal)return!1;var e=cur.votesAmountsData[cur.votesAmountsVal][3],t=cur.votesAmountsData[cur.votesAmountsVal][2];if(4!=e&&8!=t&&(2!=e||5!=t))return!1;var n=ge("confcode").value;n.length&&((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit"),ajax.post("al_payments.php",{act:"a_getvotes_validate",code:n,oid:cur.votesAmountsData[cur.votesAmountsVal][3],qid:cur.smsChkData.qid,hash:cur.smsChkData.hash},{onDone:function(){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),PaymentsBox.showProgress(),cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval(PaymentsBox.checkStatus.pbind("sms",cur.smsChkData),2e3)},onFail:function(e){return PaymentsBox.showBoxError(e),!0}}))}static smsSendCode(){if("card"===cur.votesType)return!1;if(null!=cur.votesAmountsVal){var e=cur.votesAmountsData[cur.votesAmountsVal][3],t=cur.votesAmountsData[cur.votesAmountsVal][2];if(4==e||8==t||2==e&&5==t)return PaymentsBox.smsSendPin()}var n=ge("confcode").value;n.length?((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit"),ajax.post("al_payments.php",{act:"a_getvotes_validate",pid:cur.votesAmountsVal,code:n,hash:cur.votesAmountsData[cur.votesAmountsVal].hash},{onDone:function(e){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),e&&3==cur.votesAmountsData[cur.votesAmountsVal][2]?PaymentsBox.getVotesCharge(!1,!0):e&&PaymentsBox.getVotesCharge()},onFail:function(e){return PaymentsBox.showBoxError(e),!0}})):(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)("confcode")}static smsGetCode(e){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit");var t={act:"a_getvotes_validate",hash:cur.votesAmountsData[cur.votesAmountsVal].hash,pid:cur.votesAmountsVal};e&&(t.resend=1),ajax.post("al_payments.php",t,{onDone:function(e,t){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),2==e?(PaymentsBox.showBoxError(t,"ok_msg"),(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)("confcode")):e&&3==cur.votesAmountsData[cur.votesAmountsVal][2]?PaymentsBox.getVotesCharge(!1,!0):e?PaymentsBox.getVotesCharge():(PaymentsBox.refreshBox(),show("payments_getvotes_confirm"),(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)("confcode"),cur.paymentsWideBox?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.smsSendCode,getLang("payments_change_phone_number"),PaymentsBox.showPhoneForm):PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.smsSendCode,cur.paymentsChangeType,PaymentsBox.showTypes))},onFail:function(e){return PaymentsBox.showBoxError(e),PaymentsBox.setConfirmButtons(),(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.elfocus)("confcode"),!0}})}static confirmPinCode(){var e=(0,_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__.trim)(ge("confcode").value);if(e.length){var t={act:"a_getvotes_confirm_pin",hash:cur.updateTnxHash,ps:cur.votesType,qid:cur.smsChkData.qid,pin:e};PaymentsBox.showProgress(),ajax.post("al_payments.php",t,{onDone:function(){cur.smsChkStatInt=setInterval((()=>{PaymentsBox.checkStatus(cur.votesType,cur.smsChkData)}),2e3)},onFail:function(e){PaymentsBox.refreshBox(),PaymentsBox.showBoxError(e)}})}else(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)("confcode")}static checkPinKeyPress(e){if(!((e=e||window.event).ctrlKey||e.altKey||e.metaKey)){var t=null;if(null===e.which&&e.keyCode>=32?t=String.fromCharCode(e.keyCode):0!==e.which&&0!==e.charCode&&e.which>=32&&(t=String.fromCharCode(e.which)),null!==t)return!(t<"0"||t>"9")&&void 0}}static fillBDay(){var params={act:"a_getvotes_fill_bday"};ajax.post("al_payments.php",params,{onDone:function onDone(js){if(js)try{eval(js)}catch(e){(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.logEvalError)(e,js)}}})}static showOffer(e){var t={act:"a_getvotes_offer",offer_id:e,offer_aid:cur.paymentsOfferApp||0,app_currency:cur.offersAppCurrency||0};cur.app&&cur.app.options&&(t.aid=cur.app.options.aid),cur.paymentsOfferPreview&&(t.offer_view=cur.paymentsOfferPreview),ajax.post("al_payments.php",t,{onDone:PaymentsBox.offerOnLoad,onFail:e=>(e&&(PaymentsBox.showBoxError(e),hide("payments_getvotes_wrap")),!0)})}static showNextOffers(e){var t={act:"a_getvotes_amounts",type:"offers",offset:cur.offersOffset,app_currency:cur.offersAppCurrency,hash:cur.paymentsHash};cur.app&&cur.app.options&&(t.isAppOrder=cur.paymentsOfferApp?1:0,t.aid=cur.app.options.aid),ajax.post("al_payments.php",t,{onDone:function(t,n){n&&(t||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.re)(e),cur.offersOffset+=20,ge("payments_offers_wrap").innerHTML+=n,PaymentsBox.checkOffers())},showProgress:_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton.pbind(e),hideProgress:_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton.pbind(e)})}static showConfirm(){cur.votesAmountsVal=ge("payments_getvotes_amounts")?(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.radioval)("payments_getvotes_amounts"):0;var e=ge("votes_num")?parseInt(ge("votes_num").value,10):0;if(void 0!==cur.votesAmountsVal){cur.votesAmountsVal&&null==cur.votesAmountsData[cur.votesAmountsVal]&&ge("votes_num")&&!e&&(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.notaBene)("votes_num");var t=ge("payments_spasibo_rules_accept");if(t&&!(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isChecked)(t)){var n={text:getLang("payments_spasibo_rules_not_accepted"),dir:"auto",className:"payments_terminal_tt",hasover:1};return cur.paymentsWideBox&&(n=extend(n,{shift:[-30,10]})),void(0,_web_lib_tooltip_utils__WEBPACK_IMPORTED_MODULE_9__.showTooltip)(t,n)}if((0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().changed=!0,"sms"===cur.votesType){cur.isResetCheckedMaxSmsVotesValue&&(ge("payments_getvotes_confirm_msg").innerHTML=cur.votesAmountsData.confirm_msg_again,cur.isResetCheckedMaxSmsVotesValue=!1);var r=cur.votesAmountsData.confirm_type;if(2==r&&null!=cur.votesAmountsData.checked_max_sms_votes_val&&(cur.votesAmountsVal=cur.votesAmountsData.checked_max_sms_votes_val,cur.votesAmountsData.checked_max_sms_votes_val=0,cur.isResetCheckedMaxSmsVotesValue=!0),null==cur.votesAmountsData[cur.votesAmountsVal]&&e){if(!r)return void PaymentsBox.getVotesCharge(e,!0);cur.votesAmountsData[-1]=[e,getLang("global_money_amount_rub",cur._otherAmount),cur.votesAmountsData[0][2],0],cur.votesAmountsVal=-1}void 0===cur.votesAmountsData[cur.votesAmountsVal]&&(cur.votesAmountsVal=0);var o=cur.votesAmountsData[cur.votesAmountsVal][0],i=cur.votesAmountsData[cur.votesAmountsVal][1],a=cur.votesAmountsData[cur.votesAmountsVal][2],s=cur.votesAmountsData[cur.votesAmountsVal][3],c=cur.votesAmountsData[cur.votesAmountsVal][6];if(0==a){cur.smsChkData={oid:s,qid:0,hash:cur.votesAmountsData.check_hash};var l=getLang("payments_to_get_send_sms",o);cur.paymentsWideBox||(l+=`<br/>${getLang("payments_service_cost")}`);var u=cur.votesAmountsData[cur.votesAmountsVal];if(l=(l=(l=l.replace("{number}",cur.votesAmountsData[cur.votesAmountsVal][4])).replace("{text}",`<nobr>${cur.votesAmountsData[cur.votesAmountsVal][5]}${vk.id}</nobr>`)).replace("{amount}",cur.votesAmountsData[cur.votesAmountsVal][1]),u.invoice_hash&&cur.statSessionId){PaymentsBox.showWaiting("");var d={act:"a_getvotes_invoice",type:cur.votesType,oid:s,votes:o,invoice_hash:u.invoice_hash,stat_session_id:cur.statSessionId};ajax.post("al_payments.php",d,{onDone:function(){ge("payments_getvotes_waiting_msg").innerHTML=l},onFail:function(e){return clearInterval(cur.smsChkStatInt),PaymentsBox.needContinue=0,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_waiting")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.showVotesAmounts():PaymentsBox.setButtons(cur.payments_get_votes,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.getVotesCharge:PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes),PaymentsBox.showBoxError(e),!0}})}else PaymentsBox.showWaiting(l)}else if(5==a||6==a||8==a)PaymentsBox.getVotesCharge();else if(7==a){PaymentsBox.getVotesCharge(),cur._popup_text=PaymentsBox.popupHtml(getLang("payments_cards_redirect"),"",""),cur._popup_callback=!1,cur._popup_href=!1;var _="/payments?act=go_gate&type=sms",p=Math.floor(window.screen.width/2)-350,h=Math.floor(window.screen.height/2)-300;(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.debugLog)(_),cur._popup=window.open(_,"_blank",`scrollbars=1, resizable=1, menubar=0, left=${p}, top=${h}, width=700, height=600`)}else if(1!=a&&4!=a&&1!=r)PaymentsBox.getVotesCharge(!1,!0);else{if(val("payments_box_votes_num",o),val("payments_box_amount",i),val("payments_box_votes_money",c),3==s&&(PaymentsBox.checkStatusCallback=function(e){cur.isResetCheckedMaxSmsVotesValue=!1,cur.checkedMaxVotes=e,PaymentsBox.getVotesAmounts(!0)}),2==r&&o<=cur.votesAmountsData.confirm_max_votes){if(cur.paymentsWideBox)return void PaymentsBox.getVotesCharge();hide("payments_box_confcode_wrap"),PaymentsBox.refreshBox(),show("payments_getvotes_confirm"),PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.getVotesCharge,getLang("global_back"),PaymentsBox.showVotesAmounts)}else show("payments_box_confcode_wrap"),PaymentsBox.smsGetCode();cur.votesAmountsData.resend_msg&&val("payments_getvotes_sms_resend",cur.votesAmountsData.resend_msg),cur.votesAmountsData.confirm_wait_comment&&cur.votesAmountsData.confirm_wait_comment[s]?(val("payments_getvotes_confirm_comm",cur.votesAmountsData.confirm_wait_comment[s]),show("payments_getvotes_confirm_comm_wrap")):(ge("payments_getvotes_confirm_comm").innerHTML="",hide("payments_getvotes_confirm_comm_wrap"))}}else{var f;f=cur.votesAmountsData[cur.votesAmountsVal]?cur.votesAmountsData[cur.votesAmountsVal][0]:e,cur.checkoutEnabled?PaymentsBox.submitDmrCheckout(f):"card"===cur.votesType?PaymentsBox.submitCard(f):PaymentsBox.submitPaymentSystem(f)}}}static offerOnLoad(html,js){(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),hide("payments_offers_list");var offerView=ge("payments_offer_view");if(offerView){offerView.innerHTML=html,show(offerView);try{eval(js)}catch(e){(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.logEvalError)(e,js)}}}static showWaiting(e){var t=cur.votesAmountsData[cur.votesAmountsVal]?cur.votesAmountsData[cur.votesAmountsVal][3]:0;ge("payments_getvotes_waiting_msg").innerHTML=e,t&&cur.votesAmountsData.confirm_wait_comment&&cur.votesAmountsData.confirm_wait_comment[t]?(ge("payments_getvotes_waiting_comm").innerHTML=cur.votesAmountsData.confirm_wait_comment[t],show("payments_getvotes_waiting_comm")):(ge("payments_getvotes_waiting_comm").innerHTML="",hide("payments_getvotes_waiting_comm")),PaymentsBox.refreshBox(),show("payments_getvotes_waiting"),hide("payments_getvotes_buttons"),cur.paymentsWideBox&&cur.votesAmountsData[cur.votesAmountsVal]&&cur.votesAmountsData[cur.votesAmountsVal][7]?(ge("payments_getvotes_waiting_amount").innerHTML=cur.votesAmountsData[cur.votesAmountsVal][6],ge("payments_getvotes_waiting_phone").innerHTML=cur.votesAmountsData[cur.votesAmountsVal][7],show("payments_getvotes_waiting_mo")):hide("payments_getvotes_waiting_mo"),delete cur.paymentsWaitingCache[cur.votesType],cur.smsChkStatInt&&clearInterval(cur.smsChkStatInt),cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval(PaymentsBox.checkStatus.pbind(cur.votesType,cur.smsChkData),2e3)}static showPhoneForm(e,t){geByClass1("_msg","payments_getvotes_phone").innerHTML=t||getLang("payments_get_votes_input_phone"),ge("phone").value="",PaymentsBox.refreshBox(),t&&cur.paymentsWideBox?PaymentsBox.setButtons(getLang("payments_save_phone"),PaymentsBox.saveSmsPhone):PaymentsBox.setButtons(getLang("payments_save_phone"),PaymentsBox.saveSmsPhone,getLang("global_back"),2==e?PaymentsBox.getVotesAmounts:e?PaymentsBox.showVotesAmounts:PaymentsBox.showTypes),show("payments_getvotes_phone");var n=cur.uiPhoneCountry.container;if("spasibo"===cur.votesType)hide(n),val("payments_phone_prefix","+79");else{var r=cur.uiPhoneCountry.selectedItems();if(r.length>0)val("payments_phone_prefix",r[0][3]);else for(var o=0,i=cur.countries.length;o<i;++o)cur.countries[o][0]==cur.defCountry&&val("payments_phone_prefix",cur.countries[o][3]);show(n)}return cur.paymentsBoxClass=ge("payments_box").className,addClass("payments_box","payments_phone_form"),!1}static showPaySystemsList(){return PaymentsBox.refreshBox(),cur.paymentsWideBox&&(ge("payments_getvotes_title").innerHTML=ge("payments_ps_list_title_header").innerText),show("payments_getvotes_ps","payments_votes_vkpay_promo_banner"),cur.votesType=!1,PaymentsBox.setButtons(!1,!1,cur.paymentsChangeType,PaymentsBox.showTypes),!1}static showVotesAmounts(){return PaymentsBox.refreshBox(),cur.checkoutEnabled?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm):"card"!==cur.votesType&&cur.psList[cur.votesType]&&!cur.psList[cur.votesType].in_menu?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm,getLang("payments_go_ps_list"),PaymentsBox.showPaySystemsList):PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes),show("payments_getvotes_cont","payments_getvotes_wrap","payments_getvotes_buttons"),cur.paymentsWideBox&&cur.paymentsOrderNotice&&((0,_web_lib_ui_util__WEBPACK_IMPORTED_MODULE_15__.showMsg)("payments_box_error",cur.paymentsOrderNotice,"info_msg",null),show("payments_box_error")),(0,_web_lib_accessibility__WEBPACK_IMPORTED_MODULE_16__.updateAriaElements)(),delete cur.votesAmountsData.appoveCode,!1}static showTypes(){if(cur.paymentsWideBox)return PaymentsBox.showVotesAmounts(),!1;(PaymentsBox.refreshBox(),cur.votesAmountsVal=void 0,cur.votesAmountsData=[],hide("payments_getvotes_buttons"),show("payments_getvotes_method","payments_votes_vkpay_promo_banner"),cur.paymentBoxTitle)&&(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().setOptions({title:cur.paymentBoxTitle});return!1}static setButtons(e,t,n,r){if(!cur.paymentsWideBox||e){if(e){var o=ge("payments_getvotes_submit");o&&(o.innerHTML=e,o.onclick=t,o.dataset.taskClick="",show(o,"payments_getvotes_buttons"))}else hide("payments_getvotes_buttons");if(cur.paymentsWideBox){var i=ge("payments_getvotes_back");i&&(i.innerHTML="",n&&i.appendChild((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.ce)("div",{className:"button",innerHTML:n,onclick:r,"data-task-click":""})))}else{var a=(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)();a&&(cur.paymentBoxTitle||(cur.paymentBoxTitle=a.getOptions().title),n?(geByClass1("box_title",a.titleWrap).innerHTML=`<div class="back"><span class="back__icon">${(0,_icons_desktop_getIcon24BrowserBack__WEBPACK_IMPORTED_MODULE_21__.getIcon24BrowserBack)().icon}</span>${getLang("global_box_title_back")}</div>`,geByClass1("back",a.titleWrap).onclick=r,geByClass1("back",a.titleWrap).dataset.taskClick=""):geByClass1("box_title",a.titleWrap).innerHTML=cur.paymentBoxTitle)}}else hide("payments_getvotes_buttons")}static showBoxError(e,t){if("object"==typeof e&&(e=getLang("global_error_occured")),e&&cur.paymentsWideBox&&cur.checkoutEnabled){var n=new _web_lib_message_box__WEBPACK_IMPORTED_MODULE_8__.MessageBox({title:getLang("global_error"),hideButtons:!0});(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().hide(),n.content(e).show()}else{if(e){var r=ge("payments_box_error");r&&(val(r,""),(0,_web_lib_ui_util__WEBPACK_IMPORTED_MODULE_15__.showMsg)(r,e,t||"error"),show(r))}hide("payments_box_progress","payments_iframe_container"),show("payments_getvotes_wrap"),(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),PaymentsBox.hideRowProgress(),PaymentsBox.enablePaymentTypesRows()}}static showProgress(e){val("payments_box_progress_msg","string"==typeof e?e:getLang("payments_waiting_payment_complete")),hide("payments_box_error","payments_getvotes_wrap","payments_getvotes_buttons"),cur.paymentsWideBox&&e?show("payments_box_progress_link"):e||hide("payments_box_progress_link"),show("payments_box_progress")}static hideRowProgress(){["payments_getvotes_ps",cur.paymentsWideBox?"payments_box_menu":"payments_getvotes_method"].forEach((e=>{(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)(e)&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_getvotes_active_row",ge(e)).forEach((t=>{"payments_box_menu"!==e?removeClass(t,"payments_getvotes_active_row"):removeClass(t,"payments_progress")}))}))}static refreshBox(){hide("payments_box_progress","payments_box_error","payments_getvotes_method","payments_getvotes_cont","payments_getvotes_phone","payments_getvotes_confirm","payments_getvotes_waiting","payments_getvotes_other","payments_getvotes_terminals","payments_getvotes_ps","payments_iframe_container"),show("payments_getvotes_wrap"),cur.smsChkStatInt&&!cur.paymentsWideBox&&clearInterval(cur.smsChkStatInt),cur.paymentsBoxClass&&(ge("payments_box").className=cur.paymentsBoxClass,cur.paymentsBoxClass=""),PaymentsBox.enablePaymentTypesRows()}static saveSmsPhone(){var e=(0,_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__.trim)(val("phone")),t=(0,_web_lib_utils_common__WEBPACK_IMPORTED_MODULE_7__.trim)(val(ge("payments_phone_prefix")||{})||"");e&&(cur.paymentsWaitingCache.sms&&(clearInterval(cur.paymentsWaitingCache.sms[2]),delete cur.paymentsWaitingCache.sms),cur.newSmsPhone=t+e,PaymentsBox.getVotesAmounts())}static startFormMeasure(){cur.formMeasureTime=Date.now(),vk.dev&&(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.debugLog)(cur.formMeasureTime)}static finishFormMeasure(e){if(cur.formMeasureTime){var t=Date.now()-cur.formMeasureTime;vk.dev&&(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.debugLog)(t),delete cur.formMeasureTime,(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments_frame_load_time",t,e)}}static frameMessage(e){if(!e.origin.match(/^https?:\/\/([a-zA-Z0-9\-\.]+\.)?paymentgate\.ru$/)&&!e.origin.match(/^https?:\/\/([a-zA-Z0-9\-\.]+\.)?money\.mail\.ru$/))return!1;var t={};if(!e.data||"{"!==e.data.substr(0,1)||"billing"===(t=(0,_web_lib_utils__WEBPACK_IMPORTED_MODULE_17__.parseJSON)(e.data)).type)if("pageLoad"===t.action)cur.paymentsIgnoreResize=!1;else if("paySuccess"===t.action)cur.paymentsIgnoreResize=!0,cur.checkoutEnabled&&(PaymentsBox.showProgress(),hide("payments_iframe_container"));else if("submit"===e.data||"3dsPage"===t.action)setTimeout(PaymentsBox.frameHeight.pbind(600,!0),200),addClass("payments_iframe_container",cur.checkoutEnabled?"payments_threeds_checkout_frame":"payments_threeds_frame");else if("3dsFinish"===t.action)PaymentsBox.frameHeight(),removeClass("payments_iframe_container",cur.checkoutEnabled?"payments_threeds_checkout_frame":"payments_threeds_frame");else if("resizeFrame"===t.action)if(t.action_params.height<10&&cur.paymentsIgnoreResize)cur.paymentsIgnoreResize=!1;else{var n=ge("payments_iframe_container");n&&!hasClass(n,"payments_threeds_checkout_frame")&&setTimeout(PaymentsBox.frameHeight.pbind(t.action_params.height),200)}else"putPixel"===t.action&&"page_load"===t.action_params.alias?(PaymentsBox.finishFormMeasure("dmr"),(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr","iframe_loaded")):"session_fail"===t.action?(0,_shared_lib_statlogs__WEBPACK_IMPORTED_MODULE_12__.statlogsValueEvent)("payments",0,"votes","dmr","iframe_session_fail"):"payError"===t.action&&cur.checkoutEnabled?PaymentsBox.checkoutDecline(t.action_params):"typePaymentMethod"===t.action&&cur.checkoutEnabled&&(removeClass("payments_iframe_container","payments_threeds_checkout_frame"),t.action_params&&t.action_params.system&&PaymentsBox.checkoutPayMethodChanged(t.action_params.system))}static frameHeight(e,t){var n=ge("card_iframe");n&&(e?(cur.prevFrameHeight=n.style.height,n.style.height=e+"px"):(n.style.height=cur.prevFrameHeight,removeClass("payments_iframe_container",cur.checkoutEnabled?"payments_threeds_checkout_frame":"payments_threeds_frame")));var r=ge("payments_iframe_container");r&&(cur.paymentsWideBox&&!cur.checkoutEnabled||t||(r.style.height=(e||cur.prevFrameHeight)+(cur.checkoutEnabled?0:10)+"px"),r.scrollTop=0)}static paymentCanceled(e){e?cur.isPaymentFailed=!0:cur.isPaymentCanceled=!0,PaymentsBox.frameHeight()}static checkoutDecline(e){var t=e||{};t.act="checkout_decline",t.qid=cur.smsChkData.qid,t.hash=cur.smsChkData.declineHash,ajax.post("payments",t,{onDone:function(e){return PaymentsBox.stopCheckAndShowError(e),!0},onFail:function(e){return PaymentsBox.stopCheckAndShowError(e),!0}})}static checkoutPayMethodChanged(e){e&&ajax.post("payments",{act:"checkout_ps_choose",qid:cur.smsChkData.qid,pay_method:e})}static stopCheckAndShowError(e){clearInterval(cur.smsChkStatInt),PaymentsBox.needContinue=0,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_waiting")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.showVotesAmounts():cur.checkoutEnabled?PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm):PaymentsBox.setButtons(cur.payments_get_votes,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.getVotesCharge:PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes),PaymentsBox.showBoxError(e)}static complete(e,t){cur.paymentCompleteParams=t,cur.isPaymentComplete=!0}static checkStatus(e,t,n,r){if("sms"===e&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")&&!cur.paymentsWideBox&&7!=cur.votesAmountsData[cur.votesAmountsVal][2])if(15==cur.smsChkStatCnt)ge("payments_box_progress_msg").innerHTML=getLang("payments_waiting_payment_complete_still");else if(cur.smsChkStatCnt>30){return clearInterval(cur.smsChkStatInt),cur.isPaymentAttemted=!0,(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().hide(),void(0,_web_lib_message_box__WEBPACK_IMPORTED_MODULE_8__.showFastBox)(getLang("payments_internet_getting_votes"),getLang("payments_get_votes_delay"))}var o={act:"a_getvotes_check",type:e,votes_purchase:cur.isPaymentsAppOrder||cur.paymentsWideBox||cur.paymentsInstantPayType?0:1};t&&(t.oid||t.qid)?(o.oid=t.oid,o.qid=t.qid,o.hash=t.hash):o.hash=cur.psList[e].check_hash,0==cur.smsChkStatCnt&&(o.start=1),cur.statSessionId&&(o.stat_session_id=cur.statSessionId),t.test&&(o.test=1);var i=r||(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)();ajax.post("al_payments.php",o,{onDone:function(n,r,o){if("sms"===e&&cur._popup&&cur._popup.closed)return clearInterval(cur.smsChkStatInt),cur.smsChkStatCnt=0,PaymentsBox.showBoxError(getLang("payments_payment_cancelled"),"info_msg"),void PaymentsBox.setConfirmButtons();if(n){if(1==n){for("mailmoney_vkpay"===e&&WkView&&(i._show(),cur.onExternalAppDone=null,WkView.hide(!1,!0)),cur.isPaymentAttemted=!0,PaymentsBox.needContinue&&(cur.needContinue=1,PaymentsBox.needContinue=0);boxQueue.count();)boxQueue.hideLast(!1);if((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.re)("left_block10_0"),r&&!cur.isPaymentsAppOrder&&(!cur.paymentsTryCompleteOrder||!i.onDone)){var a=new _web_lib_message_box__WEBPACK_IMPORTED_MODULE_8__.MessageBox({width:400,hideButtons:!0,bodyStyle:"padding: 0; border-radius: 8px;"});a.content(r),a.show()}o&&(0,_web_lib_utils__WEBPACK_IMPORTED_MODULE_17__.updateMoney)(o)}else if(2==n||10==n)(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_waiting")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_iframe_container")?PaymentsBox.showVotesAmounts():PaymentsBox.setButtons(cur.payments_get_votes,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.getVotesCharge:PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes),PaymentsBox.showBoxError(r);else if(3==n){var s="sms"===e;cur.votesAmountsData[cur.votesAmountsVal]?(val("payments_box_votes_num",cur.votesAmountsData[cur.votesAmountsVal][0]),val("payments_box_amount",cur.votesAmountsData[cur.votesAmountsVal][1]),val("payments_box_votes_money",s?cur.votesAmountsData[cur.votesAmountsVal][6]:cur.votesAmountsData[cur.votesAmountsVal][1])):(val("payments_box_votes_num",cur._otherVotes),val("payments_box_amount",cur._otherAmount+" "+(0,_web_lib_lang__WEBPACK_IMPORTED_MODULE_10__.langNumeric)(cur._otherAmount,cur.votesAmountsData.currency_price_str)),val("payments_box_votes_money",cur._otherAmount+" "+(0,_web_lib_lang__WEBPACK_IMPORTED_MODULE_10__.langNumeric)(cur._otherAmount,cur.votesAmountsData.currency_price_str))),s||(val("payments_getvotes_confirm_msg",getLang("payments_get_votes_ps_enter_code")),hide("payments_getvotes_confirm_amount")),cur.votesAmountsData.confirm_wait_comment&&cur.votesAmountsData.confirm_wait_comment[t.oid]?(ge("payments_getvotes_confirm_comm").innerHTML=cur.votesAmountsData.confirm_wait_comment[t.oid],show("payments_getvotes_confirm_comm_wrap")):s&&(ge("payments_getvotes_confirm_comm").innerHTML="",hide("payments_getvotes_confirm_comm_wrap")),"spasibo"===e&&(cur.updateTnxHash=r),PaymentsBox.refreshBox(),show("payments_box_confcode_wrap","payments_getvotes_confirm"),s&&r&&PaymentsBox.showBoxError(r),ge("confcode").onkeypress=s?"":PaymentsBox.checkPinKeyPress,PaymentsBox.setButtons(cur.payments_get_votes,s?PaymentsBox.smsSendCode:PaymentsBox.confirmPinCode,cur.paymentsChangeType,PaymentsBox.showTypes)}else{if(4==n){if(!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_waiting")&&!cur.paymentsWaitingCache.sms){var c=getLang("payments_to_get_send_sms",cur.votesAmountsData[cur.votesAmountsVal][0]);cur.paymentsWideBox||(c+=`<br/>${getLang("payments_service_cost")}`),c=(c=(c=c.replace("{number}",r.service_number)).replace("{text}",`<nobr>${r.message_text}</nobr>`)).replace("{amount}",cur.votesAmountsData[cur.votesAmountsVal][1]),PaymentsBox.showWaiting(c)}return}if(5==n)PaymentsBox.refreshBox(),PaymentsBox.showConfirm();else if(6==n)delete cur.votesAmountsData.oauth_url,delete cur.paymentsInstantPayType,PaymentsBox.showVotesAmounts(),PaymentsBox.showBoxError(getLang("payments_instant_pay_amount_limit_error")),PaymentsBox.setConfirmButtons(),hide("payments_remember_wallet",geByClass1("payments_getvotes_confirm_descr","payments_getvotes_cont"));else{if(7==n)return void(cur._popup&&!cur._popup_href&&(cur._popup_href=r,cur._popup.location.href=r));if(8==n)return void PaymentsBox.checkStatusCallback(r);if(9==n)return void PaymentsBox.show3DsFrame(r,o)}}clearInterval(cur.smsChkStatInt),cur.smsChkStatCnt=0}},onFail:function(e){return PaymentsBox.stopCheckAndShowError(e),!0}}),cur.smsChkStatCnt++}static checkStatusCallback(e){}static getVotesCharge(e,t){if(!(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.isButtonLocked)("payments_getvotes_submit")&&!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")&&((e=parseInt(e,10))||null!=cur.votesAmountsVal&&cur.votesAmountsData[cur.votesAmountsVal])){var n={act:"a_getvotes_charge",type:cur.votesType,hash:cur.paymentsHash,stat_session_id:cur.statSessionId},r=PaymentsBox.getEmail();""!==r&&(r&&(n.email=r),t?(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit"):PaymentsBox.showProgress(),e?(n.pid=-1,n.votes=e):(n.pid=cur.votesAmountsVal,-1==cur.votesAmountsVal&&(n.votes=cur.votesAmountsData[cur.votesAmountsVal][0])),cur.isResetCheckedMaxSmsVotesValue&&(n.pay_by_repay_status=1),PaymentsBox.disablePaymentTypesRows(),ajax.post("al_payments.php",n,{onDone:n=>{PaymentsBox.votesChargeOnDone(n,e,t)},onFail:e=>((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_box_progress")&&PaymentsBox.setButtons(cur.payments_get_votes,(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_confirm")?PaymentsBox.getVotesCharge:PaymentsBox.showConfirm,cur.paymentsChangeType,PaymentsBox.showTypes),PaymentsBox.showBoxError(e),!0)}))}}static votesChargeOnDone(e,t,n){if(e)if((0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),-1==e)PaymentsBox.getVotesAmounts(!0);else if(e.qid)if(cur.smsChkData=e,n){var r=getLang("payments_for_get_n_votes",t||cur.votesAmountsData[cur.votesAmountsVal][0]),o=cur.votesAmountsData.confirm_wait_msg.replace("{amount}",r);if(o+=t?`<br/>${getLang("payments_service_cost_rubles",cur._otherAmount)}`:`<br/>${getLang("payments_service_cost").replace("{amount}",cur.votesAmountsData[cur.votesAmountsVal][1])}`,cur.paymentsWideBox)o+=`<br><br/><a onclick="return PaymentsBox.showPhoneForm(1);">${getLang("payments_change_phone_number")}</a>`;PaymentsBox.showWaiting(o)}else cur.smsChkStatCnt=0,cur.smsChkStatInt=setInterval(PaymentsBox.checkStatus.pbind(cur.votesType,e),2e3)}static getVotesAmounts(e,t,n){if(null!=t&&cur.paymentsWideBox){if(cur.votesType==t&&cur.votesTypeInit!=t&&((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_cont")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_terminals")||(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_ps")))return;(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_waiting")?cur.paymentsWaitingCache[cur.votesType]=[ge("payments_getvotes_title").innerHTML,ge("payments_getvotes_waiting").innerHTML,cur.smsChkStatInt]:cur.smsChkStatInt&&!cur.paymentsWaitingCache[t]&&clearInterval(cur.smsChkStatInt),cur.votesType=t}else null!=t&&(cur.votesType=t);if(cur.votesType){if(cur.paymentsWideBox&&!n&&(n=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(geByClass1("payments_method_"+cur.votesType,ge("payments_box_menu")))),cur.paymentsWideBox&&cur.paymentsTypesSum&&cur.paymentsTypesSum[t]){var r=ge("payments_summary_bill");r?r.innerHTML=cur.paymentsTypesSum[t]:val("payments_order_sum",cur.paymentsTypesSum[t]),each((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_tt"),((e,t)=>{(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.re)(t)}))}var o="term"===cur.votesType||"ps"===cur.votesType;if(o){PaymentsBox.refreshBox(),hide("payments_getvotes_method");var i="";if("term"===cur.votesType?(show("payments_getvotes_terminals"),hide("payments_votes_vkpay_promo_banner"),i="payments_terminals_title_header"):(show("payments_getvotes_ps"),i="payments_ps_list_title_header"),cur.paymentsWideBox&&(hide(i),ge("payments_getvotes_title").innerHTML=ge(i).innerText),PaymentsBox.setButtons(!1,!1,cur.paymentsChangeType,PaymentsBox.showTypes),!cur.paymentsWideBox)return}for(var a=["payments_getvotes_ps",cur.paymentsWideBox?"payments_box_menu":"payments_getvotes_method"],s=0;s<a.length;s++){var c=a[s];if(!(!(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)(c)||cur.paymentsWideBox&&!n||"payments_box_menu"===c&&(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_ps")&&n&&hasClass(n.parentNode,"payments_getvotes_ps_list"))){var l=ge(c),u=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_getvotes_active_row",l);if(!e&&u.length&&!cur.paymentsWideBox)return;u.forEach((e=>{removeClass(e,"payments_getvotes_active_row"),cur.paymentsWideBox&&!o&&removeClass(e,"payments_progress")}))}}if(n&&(!cur.paymentsWideBox||"payments_box_menu"!==n.parentNode.id||o||e||addClass(n,"payments_progress"),addClass(n,"payments_getvotes_active_row")),cur.paymentsWideBox&&cur.paymentsWaitingCache[t])return ge("payments_getvotes_title").innerHTML=cur.paymentsWaitingCache[t][0],ge("payments_getvotes_waiting").innerHTML=cur.paymentsWaitingCache[t][1],PaymentsBox.refreshBox(),show("payments_getvotes_waiting","payments_getvotes_title"),hide("payments_getvotes_buttons"),void PaymentsBox.hideRowProgress();if(!o){(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.isVisible)("payments_getvotes_buttons")&&!cur.paymentsWideBox&&(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.lockButton)("payments_getvotes_submit");var d={act:"a_getvotes_amounts",type:cur.votesType,prefer_votes:cur.paymentsPreferVotes,hash:cur.paymentsHash};if(cur.statSessionId&&(d.stat_session_id=cur.statSessionId),cur.isPaymentsAppOrder&&cur.paymentsOrderAppId&&(d.aid=cur.paymentsOrderAppId,cur.paymentsOrderBillPeriod&&(d.bill_period=cur.paymentsOrderBillPeriod),cur.paymentsOrderDiscount&&(d.discount=cur.paymentsOrderDiscount)),"sms"===d.type)cur.checkedMaxVotes&&(d.checked_max_votes=cur.checkedMaxVotes,cur.checkedMaxVotes=0),cur.newSmsPhone&&(d.phone=cur.newSmsPhone,cur.newSmsPhone=!1),cur.isCorpPhone&&(d.corp=cur.isCorpPhone,cur.isCorpPhone=!1);else if("offers"===d.type){if(cur.app&&cur.app.options&&(d.isAppOrder=cur.paymentsOfferApp?1:0,d.aid=cur.app.options.aid,d.orderBox=cur.isPaymentsAppOrder?1:0),cur.paymentsPreload)return PaymentsBox.getVotesAmountsOnDone.apply(this,cur.paymentsPreload),cur.paymentsPreload=!1,void(cur.paymentsOfferPreload&&(PaymentsBox.offerOnLoad.apply(this,cur.paymentsOfferPreload),cur.paymentsOfferPreload=!1,cur.paymentsOneOffer=!0))}else if("spasibo"===d.type)cur.newSmsPhone&&(d.phone=cur.newSmsPhone,cur.newSmsPhone=!1),cur.needContinue&&(d.continue=1,cur.needContinue=0);else if(cur.psList[d.type]&&cur.psList[d.type].simple_redirect)return PaymentsBox.hideRowProgress(),void PaymentsBox.submitPaymentSystem();ajax.post("al_payments.php",d,{onDone:PaymentsBox.getVotesAmountsOnDone,onFail:e=>(PaymentsBox.showBoxError(e),!0)})}}}static getVotesAmountsOnDone(result,html,data,js,title){if(PaymentsBox.hideRowProgress(),(0,_web_lib_ui__WEBPACK_IMPORTED_MODULE_6__.unlockButton)("payments_getvotes_submit"),cur.paymentsWideBox&&(title&&(val("payments_getvotes_title",title),show("payments_getvotes_title")),data&&data.menu_money)){var sumWrap=ge("payments_summary_bill");sumWrap?sumWrap.innerHTML=data.menu_money:val(`payments_method_${cur.votesType}_descr`,data.menu_money)}if(hide("payments_votes_vkpay_promo_banner"),-1!=result)if(-2!=result)if(-3!=result){if(!result)return PaymentsBox.showProgress(""),void(cur.smsAmountsInt=setTimeout((()=>{PaymentsBox.getVotesAmounts(!0)}),1e3));if(html){var other;if(2==result?(other=ge("payments_getvotes_other"),val(other,html)):val("payments_getvotes_cont",html),cur.votesAmountsData=data,(cur.fromInstantPay&&2==cur.votesAmountsData.confirm_type||2!=cur.votesAmountsData.confirm_type||!cur.votesAmountsData.checked_max_sms_votes_val)&&PaymentsBox.showVotesAmounts(),cur.paymentsPreload&&"offers"===cur.votesType?PaymentsBox.setButtons(!1):"offers"===cur.votesType?PaymentsBox.setButtons(!1,!1,cur.paymentsChangeType,PaymentsBox.showTypes):cur.paymentsPreload&&PaymentsBox.setButtons(cur.payments_get_votes,PaymentsBox.showConfirm),window.radioBtns.payments_getvotes_amounts={els:Array.prototype.slice.apply((0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("radiobtn",ge("payments_getvotes_amounts")))},data.confirm_msg&&data.confirm_type&&val("payments_getvotes_confirm_msg",data.confirm_msg),2==result&&(hide("payments_getvotes_wrap"),show(other)),js)try{eval(js)}catch(e){(0,_web_lib_debug_tools__WEBPACK_IMPORTED_MODULE_14__.logEvalError)(e,js)}cur.instantNeedCVV&&(PaymentsBox.showConfirm(),cur.instantNeedCVV=!1),cur.paymentsEmailInput=ge("payments_receipt_email"),cur.paymentsEmailCheckbox=!!cur.paymentsEmailInput&&geByClass1("_checkbox",(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.domPN)(cur.paymentsEmailInput))}}else{var rows=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_getvotes_method_opt","payments_box_menu");hide(geByClass1("payments_getvotes_active_row","payments_box_menu"));for(var i=0;i<rows.length;i++){var row=rows[i];if(!hasClass(row,"payments_getvotes_active_row")){row.onclick();break}}}else PaymentsBox.showPhoneForm(!1,html);else PaymentsBox.showPhoneForm()}static popupHtml(e,t,n){return`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head>\n    <meta http-equiv="content-type" content="text/html; charset=windows-1251" />\n    <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n    <style>\n        body {font-family:tahoma,verdana,arial,sans-serif,Lucida Sans; font-size:11px;}\n        .text {position:relative; top:40%; text-align:center; line-height:24px;}\n        .text img {margin-bottom:8px;}\n        .text_container {position:absolute; top:0; left:0; right:0; bottom:0; line-height:150%; height: 100%;}\n    </style>\n    <script type="text/javascript">\n      if (!window.vk) window.vk = {loginscheme: '${vk.loginscheme}', ip_h: '${vk.ip_h}', __domain: '${(0,_shared_lib_site__WEBPACK_IMPORTED_MODULE_20__.getHostName)()}'};\n    <\/script>\n    <script type="text/javascript" src="/dist/workers/payments.js"><\/script>\n</head>\n<body>\n${t}\n<div id="wait_text_container" class="text_container">\n    <div class="text">\n        <img src="/images/progress.gif" /><br/>${e}\n    </div>\n</div>\n<script type="text/javascript">\n  var st = setTimeout(function() {try {${n}; clearTimeout(st)} catch(e) {}}, 100)\n<\/script>\n</body>\n</html>`}static viewOffer(e){this.setButtons(e,(()=>{ge("start_offer").submit(),PaymentsBox.setButtons(getLang("payments_back_to_offers_list"),PaymentsBox.backToOffersList,getLang("global_cancel"),PaymentsBox.backToOffersList)}),getLang("global_cancel"),PaymentsBox.backToOffersList)}static backToOffersList(){if(cur.paymentsOneOffer)return(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().hide();hide("payments_offer_view"),show("payments_offers_list"),cur.votesTypeInit||!1===cur.votesTypeInit?PaymentsBox.setButtons(!1):PaymentsBox.setButtons(!1,!1,cur.paymentsChangeType,PaymentsBox.showTypes)}static initializeOfferChecker(e,t,n,r){cur.offersOffset=e,cur.offersAppCurrency=t,PaymentsBox.checkOffersList=[],PaymentsBox.checkOffersDo=()=>{if(!n){var e=PaymentsBox.checkOffersList.join(",");PaymentsBox.checkOffersList=[],ajax.post("al_payments.php",{act:"a_offers_stat",offers:e,hash:r}),PaymentsBox.checkOffersTO=!1}},PaymentsBox.checkOffers(),addEvent(ge("box_layer_wrap"),"scroll",PaymentsBox.checkOffers)}static removeCheckOffersEvent(){removeEvent(ge("box_layer_wrap"),"scroll",PaymentsBox.checkOffers)}static checkOffers(){var e=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_offer",ge("payments_offers_wrap")),t=ge("box_layer_wrap").scrollTop,n=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.getSize)("box_layer_wrap")[1];e.forEach((e=>{var r=e,o=r.offsetTop;o+30<t+n&&o+(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.getSize)(r)[1]-20>t&&!r.getAttribute("checked")&&(r.setAttribute("checked",1),PaymentsBox.checkOffersList.push(r.id.substr(15)),PaymentsBox.checkOffersTO||(PaymentsBox.checkOffersTO=setTimeout(PaymentsBox.checkOffersDo,1e3)))}))}static offersRemoveButtons(){cur.votesTypeInit?PaymentsBox.setButtons(!1):PaymentsBox.setButtons(cur.paymentsChangeType,PaymentsBox.showTypes,getLang("global_close"),(0,_web_lib_box_utils__WEBPACK_IMPORTED_MODULE_5__.curBox)().hide)}static disablePaymentTypesRows(){var e=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_getvotes_method_opt");if(e&&e.length>0)for(var t=0;t<e.length;t++){var n=e[t];n.classList.contains("payments_getvotes_active_row")?n.classList.add("payments_getvotes_noevents_row"):n.classList.add("payments_getvotes_disabled_row","payments_getvotes_noevents_row")}}static enablePaymentTypesRows(){var e=(0,_web_lib_dom__WEBPACK_IMPORTED_MODULE_4__.geByClass)("payments_getvotes_method_opt");if(e&&e.length>0)for(var t=0;t<e.length;t++)e[t].classList.remove("payments_getvotes_disabled_row","payments_getvotes_noevents_row")}static handlePaymentCompleteMessage(e){e.origin==window.origin&&e.data.type&&"paymentCompleteMessage"===e.data.type&&window.PaymentsBox.complete(e.data.newUrl,e.data.params)}}},91789:(e,t,n)=>{"use strict";n.d(t,{isImgBlurred:()=>r});n(51876);function r(e){if(!e)return!1;var t=e.photoRaw?e.photoRaw.split("_")[0]:"";return!(!e.restrictionBlur||cur.unblurredPhotos&&cur.unblurredPhotos.indexOf(e.photoRaw)>-1||cur.unblurredOwners&&cur.unblurredOwners.indexOf(t)>-1)}},73166:(e,t,n)=>{"use strict";n.d(t,{initSettingsAddressBox:()=>c});n(51876);var r=n(15544),o=n(49535),i=n(76852),a=n(86409),s=n(24041);function c(e){var t=document.querySelector("#settdbx_addr"),n=document.querySelector("#settdbx_addr_tt_place");t.onfocus=function(){-2===cur.addrChecked&&(0,i.showTooltip)(n,{text:getLang("settings_addrbox_hint"),dir:"left",slideX:15,className:"settings_pwd_tt",shift:[-12,-15,0],onCreate:function(){(0,o.removeEvent)(n,"mouseout")}})},t.onblur=function(){n.tt&&n.tt.hide()},(0,r.elfocus)(t),setTimeout(r.elfocus.pbind(t),100),(0,r.setStyle)(t,{width:230-ge("settdbx_base").offsetWidth-8}),extend(cur,{settDomainCheckAddress:function(e){clearTimeout(cur.addressCheckTO),cur.lastAddress!==(0,r.val)("settdbx_addr")&&(cur.addressCheckTO=setTimeout(cur.settDomainDoCheckAddress,e||0))},settDomainDoCheckAddress:function(){var e=document.querySelector("#settdbx_submit"),n=document.querySelector("#settdbx_advices");cur.lastAddress=(0,r.val)("settdbx_addr"),ajax.post("al_settings.php",{act:"a_check_address",name:cur.lastAddress,from:"box"},{onDone:function(t){cur.addrChecked=1,s.FlatButton.setLabel(e,t),s.FlatButton.setDisabled(e,!1),(0,r.val)(n,"")},onFail:function(o){var i=(o=o.split("<*>"))[1],a=o[2];return o=o[0],a?(cur.addrChecked=-2,t.onfocus()):(cur.addrChecked=-1,t.onblur()),s.FlatButton.setLabel(e,o),s.FlatButton.setDisabled(e,!0),(0,r.val)(n,i),!0}})},settDomainAdvisedAddress:function(e){(0,r.val)("settdbx_addr",e),cur.settDomainCheckAddress()},settDomainAddressSubmit:function(t){if(1===cur.addrChecked){var n=(0,r.val)("settdbx_addr"),o={act:"a_change_address",hash:e,name:n};s.FlatButton.lock(t),window.ajax.post("al_settings.php",o,{onDone:function(e){nav.go(n,!1,{params:{from:"address_box"}})},showProgress:()=>s.FlatButton.lock(t),hideProgress:()=>s.FlatButton.unlock(t)})}else(0,a.notaBene)("settings_addr")}})}},19143:(e,t,n)=>{"use strict";n.d(t,{showNextPaymentsHistory:()=>i});n(30522);var r=n(86409),o=n(15544),i=(e,t)=>{var n,i;if(!(0,r.isButtonLocked)(e))return(0,r.lockButton)(e),t||(t="votes"),void 0===cur.historyOffset[t]&&(cur.historyOffset[t]=5),"transfer"===t?(n={act:"a_transfer_history"},i=(0,o.ge)("settings_transfer_history")):"subscriptions"===t?(n={act:"a_payments_subsciptions"},i=(0,o.ge)("settings_payments_subscriptions")):"games"===t?(n={act:"a_payments_games"},i=(0,o.ge)("settings_payments_games")):(n={act:"a_votes_history"},i=(0,o.ge)("settings_votes_history")),n.offset=i.rows.length,"subscriptions"===t&&(n.extra_items_count=cur.historyExtraItemsSubscriptions),ajax.post("al_settings.php",n,{onDone:function(n,a,s){var c=i.tBodies[0];if(n){if((0,r.unlockButton)(e),browser.msie){var l=(0,o.se)("<table>"+n+"</table>");Array.from((0,o.geByTag)("tr",l)).forEach((e=>{1===e.nodeType&&c.appendChild(e)}))}else c.insertAdjacentHTML("beforeEnd",n);"subscriptions"===t&&s&&(cur.historyExtraItemsSubscriptions=s)}n&&!a||((0,o.addClass)(c.lastChild,"settings_votes_history_last"),(0,o.hide)(e))}}),!1}},7739:(e,t,n)=>{"use strict";n.d(t,{FAQTutorial:()=>l});var r=n(15544),o=n(68770),i=n(86409),a="tutorial_step",s="finished";function c(){var e=geByClass(a).slice(-1)[0],t=geByClass1("content",e);t.innerHTML=getTemplate("login_tutorial_finish_appeal")+t.innerHTML}var l={tryInit(){geByClass1(a)&&c()},select(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!cur.tutorialProcessing&&!isChecked(e)){var u=gpeByClass(a,e);hasClass(u,s)||(removeClass(geByClass1("on",u),"on"),addClass(e,"on"),ajax.post("support?act=a_select_tutorial",{name:t,id:n,load:1,ban:nav.objLoc.ban||0},{onDone(e,t){l||addClass(u,s);var n,i=!0,a=ge("page_body").offsetHeight+(vk.staticheader?0:(0,r.getH)(ge("page_header_cont")));if(l)do{(n=domNS(u))&&(re(n),i=!1)}while(n);if(ge("login_blocked_wrap").innerHTML+=e,c(),"login"===nav.objLoc[0]&&t){var d=document.querySelectorAll(".tutorial_step"),_=d[d.length-1];if(o.Login.isBanExpired()){o.Login.canUnblockFast()?_.innerHTML+=getTemplate("login_unblock_by_phone_fast"):_.innerHTML+=getTemplate("login_unblock_by_phone");var p=d[d.length-1].querySelector(".help_table_question__m");p&&hide(p)}else _.innerHTML+=getTemplate("login_wait_for_ban_expiration_message")}i&&scrollToY(a)},onFail:e=>(showDoneBox(e),!1),showProgress(){cur.tutorialProcessing=!0,(0,i.lockButton)(e)},hideProgress(){cur.tutorialProcessing=!1,(0,i.unlockButton)(e)}}))}},home:()=>{nav.go("/support?act=home")},back:e=>{var t=geByClass("tutorial_step"),n=t[t.length-1];2===t.length&&hide(e),hide(n),removeClass(geByClass1("on",t[t.length-2]),"on")}}},41454:(e,t,n)=>{"use strict";n.d(t,{PLAYING:()=>r});var r="playing"},30365:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});var r=n(67294),o=n(73935),i=n(45697),a=n(59397);class s extends r.Component{constructor(){super(...arguments),this.getScrollbarWidth=()=>{var e=document.createElement("div");e.classList.add(this._scrollbarMeasureClass),document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},this.hideScrollBar=()=>{var e=document.body.getBoundingClientRect(),t=e.left+e.right<window.innerWidth,n=this.getScrollbarWidth();this.calculatedPadding=window.getComputedStyle(document.body)["padding-right"],t&&(document.body.style.paddingRight=`${parseFloat(this.calculatedPadding)+n}px`),document.body.classList.add(this._bodyHiddenOverflowClass)},this.showScrollBar=()=>{document.body.style.paddingRight=this.calculatedPadding,document.body.classList.remove(this._bodyHiddenOverflowClass)},this.onDocumentKeyDown=e=>{var t=this.props.onClose;"Escape"===e.key&&t()},this.onBackdropClick=()=>{var e=this.props,t=e.onClose,n=e.onBackdropClick;e.disableBackdropClick||(n?n():t())}}componentDidMount(){var e=this.props,t=e.disableEscapeClose,n=e.disableBodyScroll;t||document.body.addEventListener("keydown",this.onDocumentKeyDown),n&&(this._scrollbarMeasureClass=r.createElement("div",{className:"BaseModal__scrollbarMeasure"}).props.className,this._bodyHiddenOverflowClass=r.createElement("div",{className:"BaseModal__bodyHiddenOverflow"}).props.className,this.hideScrollBar())}componentWillUnmount(){var e=this.props,t=e.disableEscapeClose,n=e.disableBodyScroll;t||document.body.removeEventListener("keydown",this.onDocumentKeyDown),n&&this.showScrollBar()}renderModal(){var e=this.props.className,t=(0,a.classNames)("BaseModal",e);return r.createElement("div",{className:t,"aria-modal":"true"},r.createElement("div",{className:"BaseModal__backdrop",onClick:this.onBackdropClick}),r.createElement("div",{className:"BaseModal__content"},this.props.children))}render(){return o.createPortal(this.renderModal(),document.body)}}s.defaultProps={className:"",children:null,disableBackdropClick:!1,disableEscapeClose:!1,disableBodyScroll:!1},s.propTypes={onClose:i.func.isRequired,onBackdropClick:i.func,children:i.oneOfType([i.arrayOf(i.node),i.node]),className:i.string,disableBackdropClick:i.bool,disableBodyScroll:i.bool,disableEscapeClose:i.bool};const c=s},53449:(e,t,n)=>{"use strict";n.d(t,{default:()=>s});n(75115),n(91181),n(96253);var r=n(67294),o=n(73935),i=n(45697),a=n(59397);class s extends r.Component{constructor(e){super(e),this.onClick=()=>{if(!this.state.dropdown||this.state.dropdown.removed){var e=this.props,t=e.text,n=e.position,r=e.align,o=e.marginTop,i=e.marginLeft,s=e.horizontalPosition,c=(0,a.getOffsetRect)(this.el);this.update({text:t,position:n,horizontalPosition:s,align:r,rect:c,marginTop:o,marginLeft:i})}else this.update()},this.onMouseEnter=()=>{this.callerHovered=!0,this.timeouts.appear=setTimeout((()=>{if(this.el&&this.callerHovered){var e=this.props,t=e.position,n=e.align,r=e.marginTop,o=e.marginLeft,i=e.horizontalPosition,s=(0,a.getOffsetRect)(this.el);this.update({position:t,align:n,horizontalPosition:i,rect:s,marginTop:r,marginLeft:o})}}),80)},this.onMouseLeave=()=>{this.callerHovered=!1,this.timeouts.callerDisappear=setTimeout((()=>{this.callerHovered||this.hovered||this.update()}),250)},this.onDropdownMouseEnter=()=>{"hover"===this.props.trigger&&(this.hovered=!0)},this.onDropdownMouseLeave=()=>{"hover"===this.props.trigger&&(this.hovered=!1,this.timeouts.disappear=setTimeout((()=>{this.callerHovered||this.hovered||this.update()}),250))},this.onDocumentClick=e=>{!this.state.dropdown||this.state.dropdown.removed||this.el.contains(e.target)||this.update()},this.onResize=()=>{if(this.state.dropdown&&!this.state.dropdown.removed){var e=this.props,t=e.text,n=e.position,r=e.align,o=e.marginTop,i=e.marginLeft,s=e.horizontalPosition,c=(0,a.getOffsetRect)(this.el);this.update({text:t,position:n,align:r,horizontalPosition:s,rect:c,marginTop:o,marginLeft:i})}},this.onTransitionEnd=e=>{"visibility"===e.propertyName&&this.state.dropdown&&this.state.dropdown.removed&&this.setState({dropdown:void 0})},this.onItemClick=(e,t)=>{t.separator||(this.update(),t.onClick&&t.onClick(e))},this.state={},this.timeouts={}}componentDidMount(){this.el=o.findDOMNode(this),"click"===this.props.trigger?(this.el.addEventListener("click",this.onClick),document.addEventListener("mousedown",this.onDocumentClick),window.addEventListener("resize",this.onResize)):(this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave))}componentWillUnmount(){Object.keys(this.timeouts).forEach((e=>{clearTimeout(this.timeouts[e])})),"click"===this.props.trigger?(this.el.removeEventListener("click",this.onClick),document.removeEventListener("mousedown",this.onDocumentClick),window.removeEventListener("resize",this.onResize)):(this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",this.onMouseLeave)),this.defaultNode&&(this.defaultNode.parentNode.removeChild(this.defaultNode),delete this.defaultNode)}update(e){if(!e)return this.setState({dropdown:Object.assign({},this.state.dropdown,{removed:!0})});var t=e.position,n=e.align,r=e.horizontalPosition,o=e.rect,i=e.marginTop,a=e.marginLeft,s=o.left,c=o.top;switch(t){case"t":"center"===r?s+=.5*o.width:"right"===r&&(s+=o.width);break;case"r":s+=o.width,c+=.5*o.height;break;case"b":c+=o.height,"center"===r?s+=.5*o.width:"right"===r&&(s+=o.width);break;case"l":c+=.5*o.height}s=Math.round(s+a),c=Math.round(c+i),this.setState({dropdown:{position:t,align:n,x:s,y:c}})}renderDropdown(){if(!this.state.dropdown)return null;var e=this.state.dropdown,t=e.x,n=e.y,o=e.position,i=e.align,s=e.removed,c=(0,a.classNames)("Dropdown",`Dropdown--${o}`,{"Dropdown--removed":!!s,[`Dropdown--align-${i}`]:"t"===o||"b"===o},`Dropdown--${this.props.appearance}`,this.props.className);return r.createElement("div",{className:c,style:{top:n,left:t},onTransitionEnd:e=>this.onTransitionEnd(e),onMouseEnter:this.onDropdownMouseEnter,onMouseLeave:this.onDropdownMouseLeave},r.createElement("ul",{className:"Dropdown__in"},this.props.data.map(((e,t)=>r.createElement("li",{className:(0,a.classNames)("Dropdown__item",{Dropdown__itemSeparator:e.separator},{Dropdown__itemNegative:e.negative},{Dropdown__itemNoHover:e.noHover}),onClick:t=>this.onItemClick(t,e),key:void 0!==e.id?e.id:t},e.text)))))}render(){var e=this.renderDropdown();return e?(this.defaultNode||"undefined"==typeof window||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),r.createElement(r.Fragment,null,this.props.children,o.createPortal(e,this.defaultNode))):this.props.children}}s.propTypes={data:i.arrayOf(i.shape({id:i.oneOfType([i.string,i.number]),text:i.oneOfType([i.string,i.element]),separator:i.bool,negative:i.bool,noHover:i.bool,onClick:i.func})).isRequired,position:i.oneOf(["t","r","b","l"]),horizontalPosition:i.oneOf(["left","center","right"]),align:i.oneOf(["left","center","right"]),appearance:i.oneOf(["primary","fancy"]),marginTop:i.number,marginLeft:i.number,trigger:i.oneOf(["click","hover"]),className:i.oneOfType([i.string,i.object])},s.defaultProps={position:"b",horizontalPosition:"center",align:"center",marginTop:0,marginLeft:0,trigger:"click",className:"",appearance:"primary"}},23985:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});n(30522),n(66108),n(96253),n(91181),n(79665),n(95767);var r=n(67294),o=n(45697),i=n(39664),a=n(59397);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}class l extends r.Component{constructor(e){super(e),this.checkLoad=(0,a.throttle)((e=>{var t=s(e,3),n=t[0],r=t[1],o=t[2];if(!this.loading){if(!this.props.virtualized&&!this.props.hasMore){if(this.props.onScroll)return;return this.detachListeners()}r-n-o<=this.props.threshold&&(this.loading=!0,this.props.loadMore().then((()=>{this.loading=!1})))}}),34),this.onScroll=e=>{var t=this.getScrollData();this.props.onScroll&&this.props.onScroll(e),this.props.virtualized&&this.processChildren(this.props.children,t),this.props.hasMore&&this.checkLoad(t)},this.getRef=e=>{this.container=e,this.props.virtualized&&this.setState(this.getChildrenData(this.props.children,this.getScrollData()))},this.useWindowScroll=e.useWindowScroll,e.virtualized&&(this.state={before:0,after:e.children.length,start:0,end:0})}getScrollData(){var e=this.useWindowScroll?document.documentElement:this.container;return[this.getScrollTop(),e?e.scrollHeight:0,e?e.clientHeight:0]}getScrollTop(){var e=document.documentElement||document.body.parentNode||document.body;return this.useWindowScroll?void 0!==window.pageYOffset?window.pageYOffset:e.scrollTop:this.container?this.container.scrollTop:0}attachListeners(){var e=this.useWindowScroll?window:this.container;this.container&&(e.addEventListener("scroll",this.onScroll,this.props.useCapture),e.addEventListener("resize",this.onScroll,this.props.useCapture))}detachListeners(){var e=this.useWindowScroll?window:this.container;this.container&&(e.removeEventListener("scroll",this.onScroll,this.props.useCapture),e.removeEventListener("resize",this.onScroll,this.props.useCapture))}processChildren(e,t){var n=this.state,r=this.getChildrenData(e,t||this.getScrollData()),o=r.start,i=r.end,a=r.before,s=r.after;o===n.start&&i===n.end&&a===n.before&&s===n.after||this.setState(r)}getChildrenData(e,t){var n=s(t,3),r=n[0],o=n[1],i=n[2],a=this.useWindowScroll?window:this.container,c=a&&a.offsetHeight;if(!a||0===o||0===i)return{start:0,end:0,before:0,after:e.length};i=Math.max(i,c);var l=e.length,u=Math.max(Math.floor(r/this.props.itemHeight)-1,0),d=Math.min(Math.floor((r+2*i)/this.props.itemHeight+1),l);return{start:u,end:d,before:u,after:l-d}}UNSAFE_componentWillReceiveProps(e){this.props.virtualized&&this.processChildren(e.children)}componentDidMount(){this.attachListeners()}componentWillUnmount(){this.detachListeners()}render(){return r.createElement("div",{className:(0,a.classNames)("InfiniteScroll",this.props.className),ref:this.getRef,style:this.props.style},this.props.virtualized&&this.state.before>0&&r.createElement("div",{style:{height:this.state.before*this.props.itemHeight},key:"before"}),this.props.virtualized?[].concat(this.props.children).slice(this.state.start,this.state.end):this.props.children,this.props.virtualized&&this.state.after>0&&r.createElement("div",{style:{height:this.state.after*this.props.itemHeight},key:"after"}),this.props.hasMore&&(this.props.loader||r.createElement("div",{className:"InfiniteScroll__loader",key:"loader"},r.createElement(i.default,{color:this.props.spinnerColor}))))}}l.propTypes={useWindowScroll:o.bool,virtualized:o.bool,hasMore:o.bool,loadMore:o.func.isRequired,useCapture:o.bool,threshold:o.number,itemHeight:o.number,onScroll:o.func,spinnerColor:o.string},l.defaultProps={useWindowScroll:!1,virtualized:!1,hasMore:!0,useCapture:!1,threshold:100,itemHeight:55}},89366:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});n(75115),n(95767),n(91181),n(96253);var r=n(67294),o=n(45697),i=n(59397);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}class c extends r.Component{constructor(e){super(e),this.onChange=e=>{this.isControlledOutside||this.setState({value:e.target.value}),this.props.onChange&&this.props.onChange(e)},this.getRef=e=>{this.element=e},this.onFocus=e=>{this.props.onFocus&&this.props.onFocus(e)},void 0!==e.value||e.isControlledOutside?this.isControlledOutside=!0:this.state={value:e.initialValue||""}}render(){var e=this.props,t=e.alignment,n=e.value,o=(e.onChange,e.initialValue,e.className),c=(e.isControlledOutside,s(e,["alignment","value","onChange","initialValue","className","isControlledOutside"])),l={"Input--left":"left"===t,"Input--center":"center"===t,"Input--right":"right"===t};return r.createElement("input",a({},c,{className:(0,i.classNames)("Input",l,o),ref:this.getRef,value:this.isControlledOutside?n:this.state.value,onChange:this.onChange,onFocus:this.onFocus}))}}c.propTypes={className:o.string,type:o.oneOf(["text","password","date","datetime-local","time","month","email","number","range","tel","url","hidden"]),alignment:o.oneOf(["left","center","right"]),value:o.oneOfType([o.string,o.number]),initialValue:o.string,onChange:o.func,isControlledOutside:o.bool,onFocus:o.func},c.defaultProps={type:"text",initialValue:"",alignment:"left"}},64891:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});n(75115),n(95767),n(91181),n(96253);var r=n(67294),o=n(45697),i=n(59397);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}class c extends r.Component{render(){var e=this.props,t=e.onClick,n=e.hovered,o=e.className,c=e.children,l=s(e,["onClick","hovered","className","children"]),u=(0,i.classNames)("Link",{"Link--hovered":!!n},o);return this.props.href?r.createElement("a",a({onClick:t},l,{className:u}),c):r.createElement("span",a({onClick:t},l,{className:u}),c)}}c.propTypes={className:o.string,children:o.node,href:o.string,hovered:o.bool,onClick:o.func},c.defaultProps={href:void 0,hovered:!1,onClick:()=>{}}},61650:(e,t,n)=>{"use strict";n.d(t,{default:()=>_});n(75115);var r=n(67294),o=n(45697),i=n(30365),a=n(43927),s=n(76288),c=n(50382),l=n(59397);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}var d=e=>{var t=e.className,n=e.appearance,o=void 0===n?"white":n,d=e.title,_=e.actionButtons,p=e.onClose,h=e.children,f=e.footerHint,m=e.hasScroll,g=e.backText,v=e.onBack,y=(0,l.classNames)("Modal",`Modal--${o}`,t);return r.createElement(i.default,u({},e,{className:y}),r.createElement(a.ModalHeader,{title:d,onClose:p,backText:g,onBack:v}),Boolean(h)&&r.createElement(s.ModalBody,{hasScroll:m},h),r.createElement(c.ModalFooter,{actionButtons:_,hint:f}))};d.Header=a.ModalHeader,d.Body=s.ModalBody,d.Footer=c.ModalFooter,d.propTypes=u({},i.default.propTypes,{actionButtons:o.oneOfType([o.arrayOf(o.node),o.node]).isRequired,onClose:o.func.isRequired,title:o.oneOfType([o.arrayOf(o.node),o.node]).isRequired,appearance:o.oneOf(["white","blue"]),hasScroll:o.bool,footerHint:o.node,backText:o.string,onBack:o.func});const _=d},32821:(e,t,n)=>{"use strict";n.d(t,{ScrollContext:()=>c,Scroll:()=>l});n(75115),n(95767),n(91181),n(96253);var r=n(67294),o=n(45697),i=n(59397);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({});class l extends r.Component{constructor(){super(...arguments),this.getWrapperRef=e=>{this.wrapper=e}}componentDidMount(){var e=this.props,t=e.isNative,n=e.isShadows,r=e.neverHide,o=e.onScroll;!this.scroller&&this.context&&this.context.createScroll&&(this.scroller=this.context.createScroll(this.wrapper,{shadows:n,nativeScroll:t,hidden:!r,onScroll:o}))}componentDidUpdate(){this.scroller&&this.scroller.update()}componentWillUnmount(){this.scroller&&(this.scroller.destroy(),this.scroller=null)}render(){var e=this.props,t=e.children,n=(e.isNative,e.isShadows,e.neverHide,e.className),o=void 0===n?"":n,c=s(e,["children","isNative","isShadows","neverHide","className"]);return r.createElement("div",a({},c,{className:(0,i.classNames)("Scroll",o),ref:this.getWrapperRef}),t)}}l.propTypes={className:o.string,children:o.oneOfType([o.element,o.string]).isRequired,isNative:o.bool,isShadows:o.bool,neverHide:o.bool,onScroll:o.func},l.defaultProps={isNative:!1,isShadows:!1,neverHide:!1,onScroll:null},l.contextType=c},39664:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});n(91181),n(66108),n(96253);var r=n(67294),o=n(45697),i=n(59397);class a extends r.Component{constructor(e){super(e),this.id=Math.round(1e6*Math.random()).toString(16),this.setSpinnerParams(e)}UNSAFE_componentWillReceiveProps(e){this.setSpinnerParams(e)}setSpinnerParams(e){this.offset=Math.round(Math.PI*e.size),this.c=.5*e.size,this.animation=function(e,t){if(!e||!t)return"";var n=Object.keys(t).map((e=>e+" {"+Object.keys(t[e]).map((n=>n+":"+t[e][n])).join(";")+"}")).join("");return`@-webkit-keyframes ${e} {${n}} @keyframes ${e} {${n}}`}("dash"+this.id,{"0%":{"stroke-dashoffset":this.offset},"50%":{"stroke-dashoffset":Math.round(.25*this.offset),transform:"rotate(135deg)"},"100%":{"stroke-dashoffset":this.offset,transform:"rotate(360deg)"}})}render(){var e=this.props,t=e.style,n=e.color,o=void 0===n?"var(--icon_secondary)":n,a=e.size,s=e.duration,c=e.strokeWidth,l=e.className,u=this.id,d=this.offset,_=this.animation,p=(0,i.classNames)("Spinner",l);return r.createElement("div",{className:p,style:t},r.createElement("svg",{className:"Spinner__svg",width:a,height:a,viewBox:`0 0 ${a} ${a}`,xmlns:"http://www.w3.org/2000/svg"},r.createElement("g",{style:{width:a,height:a,transformOrigin:.5*a+"px "+.5*a+"px"}},r.createElement("style",{dangerouslySetInnerHTML:{__html:_}}),r.createElement("circle",{className:"Spinner__path",fill:"none",stroke:o,strokeDasharray:d,strokeDashoffset:d,strokeWidth:c,style:{animationName:"dash"+u,animationTimingFunction:"ease-in-out",animationDuration:s+"s",animationIterationCount:"infinite"},cx:.5*a,cy:.5*a,r:.5*a-.5*c}))))}}a.propTypes={color:o.string,size:o.number,strokeWidth:o.number,duration:o.number,className:o.string,style:o.object},a.defaultProps={color:"#5181b8",size:19,strokeWidth:2,duration:1.4,className:""}},24736:(e,t,n)=>{var r;e=n.nmd(e);var o=function(e){"use strict";var t=1e7,n=9007199254740992,r=_(n),i="0123456789abcdefghijklmnopqrstuvwxyz",a="function"==typeof BigInt;function s(e,t,n,r){return void 0===e?s[0]:void 0!==t&&(10!=+t||n)?K(e,t,n,r):Y(e)}function c(e,t){this.value=e,this.sign=t,this.isSmall=!1}function l(e){this.value=e,this.sign=e<0,this.isSmall=!0}function u(e){this.value=e}function d(e){return-n<e&&e<n}function _(e){return e<1e7?[e]:e<1e14?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/1e14)]}function p(e){h(e);var n=e.length;if(n<4&&I(e,r)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){for(var t=e.length;0===e[--t];);e.length=t+1}function f(e){for(var t=new Array(e),n=-1;++n<e;)t[n]=0;return t}function m(e){return e>0?Math.floor(e):Math.ceil(e)}function g(e,n){var r,o,i=e.length,a=n.length,s=new Array(i),c=0,l=t;for(o=0;o<a;o++)c=(r=e[o]+n[o]+c)>=l?1:0,s[o]=r-c*l;for(;o<i;)c=(r=e[o]+c)===l?1:0,s[o++]=r-c*l;return c>0&&s.push(c),s}function v(e,t){return e.length>=t.length?g(e,t):g(t,e)}function y(e,n){var r,o,i=e.length,a=new Array(i),s=t;for(o=0;o<i;o++)r=e[o]-s+n,n=Math.floor(r/s),a[o]=r-n*s,n+=1;for(;n>0;)a[o++]=n%s,n=Math.floor(n/s);return a}function E(e,n){var r,o,i=e.length,a=n.length,s=new Array(i),c=0,l=t;for(r=0;r<a;r++)(o=e[r]-c-n[r])<0?(o+=l,c=1):c=0,s[r]=o;for(r=a;r<i;r++){if(!((o=e[r]-c)<0)){s[r++]=o;break}o+=l,s[r]=o}for(;r<i;r++)s[r]=e[r];return h(s),s}function w(e,n,r){var o,i,a=e.length,s=new Array(a),u=-n,d=t;for(o=0;o<a;o++)i=e[o]+u,u=Math.floor(i/d),i%=d,s[o]=i<0?i+d:i;return"number"==typeof(s=p(s))?(r&&(s=-s),new l(s)):new c(s,r)}function b(e,n){var r,o,i,a,s=e.length,c=n.length,l=f(s+c),u=t;for(i=0;i<s;++i){a=e[i];for(var d=0;d<c;++d)r=a*n[d]+l[i+d],o=Math.floor(r/u),l[i+d]=r-o*u,l[i+d+1]+=o}return h(l),l}function C(e,n){var r,o,i=e.length,a=new Array(i),s=t,c=0;for(o=0;o<i;o++)r=e[o]*n+c,c=Math.floor(r/s),a[o]=r-c*s;for(;c>0;)a[o++]=c%s,c=Math.floor(c/s);return a}function S(e,t){for(var n=[];t-- >0;)n.push(0);return n.concat(e)}function T(e,t){var n=Math.max(e.length,t.length);if(n<=30)return b(e,t);n=Math.ceil(n/2);var r=e.slice(n),o=e.slice(0,n),i=t.slice(n),a=t.slice(0,n),s=T(o,a),c=T(r,i),l=T(v(o,r),v(a,i)),u=v(v(s,S(E(E(l,s),c),n)),S(c,2*n));return h(u),u}function D(e,n,r){return new c(e<t?C(n,e):b(n,_(e)),r)}function P(e){var n,r,o,i,a=e.length,s=f(a+a),c=t;for(o=0;o<a;o++){r=0-(i=e[o])*i;for(var l=o;l<a;l++)n=i*e[l]*2+s[o+l]+r,r=Math.floor(n/c),s[o+l]=n-r*c;s[o+a]=r}return h(s),s}function A(e,t){var n,r,o,i,a=e.length,s=f(a);for(o=0,n=a-1;n>=0;--n)o=(i=1e7*o+e[n])-(r=m(i/t))*t,s[n]=0|r;return[s,0|o]}function k(e,n){var r,o=Y(n);if(a)return[new u(e.value/o.value),new u(e.value%o.value)];var i,d=e.value,g=o.value;if(0===g)throw new Error("Cannot divide by zero");if(e.isSmall)return o.isSmall?[new l(m(d/g)),new l(d%g)]:[s[0],e];if(o.isSmall){if(1===g)return[e,s[0]];if(-1==g)return[e.negate(),s[0]];var v=Math.abs(g);if(v<t){i=p((r=A(d,v))[0]);var y=r[1];return e.sign&&(y=-y),"number"==typeof i?(e.sign!==o.sign&&(i=-i),[new l(i),new l(y)]):[new c(i,e.sign!==o.sign),new l(y)]}g=_(v)}var w=I(d,g);if(-1===w)return[s[0],e];if(0===w)return[s[e.sign===o.sign?1:-1],s[0]];r=d.length+g.length<=200?function(e,n){var r,o,i,a,s,c,l,u=e.length,d=n.length,_=t,h=f(n.length),m=n[d-1],g=Math.ceil(_/(2*m)),v=C(e,g),y=C(n,g);for(v.length<=u&&v.push(0),y.push(0),m=y[d-1],o=u-d;o>=0;o--){for(r=_-1,v[o+d]!==m&&(r=Math.floor((v[o+d]*_+v[o+d-1])/m)),i=0,a=0,c=y.length,s=0;s<c;s++)i+=r*y[s],l=Math.floor(i/_),a+=v[o+s]-(i-l*_),i=l,a<0?(v[o+s]=a+_,a=-1):(v[o+s]=a,a=0);for(;0!==a;){for(r-=1,i=0,s=0;s<c;s++)(i+=v[o+s]-_+y[s])<0?(v[o+s]=i+_,i=0):(v[o+s]=i,i=1);a+=i}h[o]=r}return v=A(v,g)[0],[p(h),p(v)]}(d,g):function(e,n){for(var r,o,i,a,s,c=e.length,l=n.length,u=[],d=[],_=t;c;)if(d.unshift(e[--c]),h(d),I(d,n)<0)u.push(0);else{i=d[(o=d.length)-1]*_+d[o-2],a=n[l-1]*_+n[l-2],o>l&&(i=(i+1)*_),r=Math.ceil(i/a);do{if(I(s=C(n,r),d)<=0)break;r--}while(r);u.push(r),d=E(d,s)}return u.reverse(),[p(u),p(d)]}(d,g),i=r[0];var b=e.sign!==o.sign,S=r[1],T=e.sign;return"number"==typeof i?(b&&(i=-i),i=new l(i)):i=new c(i,b),"number"==typeof S?(T&&(S=-S),S=new l(S)):S=new c(S,T),[i,S]}function I(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}function O(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function x(e,t){for(var n,r,i,a=e.prev(),s=a,c=0;s.isEven();)s=s.divide(2),c++;e:for(r=0;r<t.length;r++)if(!e.lesser(t[r])&&!(i=o(t[r]).modPow(s,e)).isUnit()&&!i.equals(a)){for(n=c-1;0!=n;n--){if((i=i.square().mod(e)).isUnit())return!1;if(i.equals(a))continue e}return!1}return!0}c.prototype=Object.create(s.prototype),l.prototype=Object.create(s.prototype),u.prototype=Object.create(s.prototype),c.prototype.add=function(e){var t=Y(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new c(y(n,Math.abs(r)),this.sign):new c(v(n,r),this.sign)},c.prototype.plus=c.prototype.add,l.prototype.add=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(d(n+r))return new l(n+r);r=_(Math.abs(r))}return new c(y(r,Math.abs(n)),n<0)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){return new u(this.value+Y(e).value)},u.prototype.plus=u.prototype.add,c.prototype.subtract=function(e){var t=Y(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?w(n,Math.abs(r),this.sign):function(e,t,n){var r;return I(e,t)>=0?r=E(e,t):(r=E(t,e),n=!n),"number"==typeof(r=p(r))?(n&&(r=-r),new l(r)):new c(r,n)}(n,r,this.sign)},c.prototype.minus=c.prototype.subtract,l.prototype.subtract=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new l(n-r):w(r,Math.abs(n),n>=0)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){return new u(this.value-Y(e).value)},u.prototype.minus=u.prototype.subtract,c.prototype.negate=function(){return new c(this.value,!this.sign)},l.prototype.negate=function(){var e=this.sign,t=new l(-this.value);return t.sign=!e,t},u.prototype.negate=function(){return new u(-this.value)},c.prototype.abs=function(){return new c(this.value,!1)},l.prototype.abs=function(){return new l(Math.abs(this.value))},u.prototype.abs=function(){return new u(this.value>=0?this.value:-this.value)},c.prototype.multiply=function(e){var n,r,o,i=Y(e),a=this.value,l=i.value,u=this.sign!==i.sign;if(i.isSmall){if(0===l)return s[0];if(1===l)return this;if(-1===l)return this.negate();if((n=Math.abs(l))<t)return new c(C(a,n),u);l=_(n)}return r=a.length,o=l.length,new c(-.012*r-.012*o+15e-6*r*o>0?T(a,l):b(a,l),u)},c.prototype.times=c.prototype.multiply,l.prototype._multiplyBySmall=function(e){return d(e.value*this.value)?new l(e.value*this.value):D(Math.abs(e.value),_(Math.abs(this.value)),this.sign!==e.sign)},c.prototype._multiplyBySmall=function(e){return 0===e.value?s[0]:1===e.value?this:-1===e.value?this.negate():D(Math.abs(e.value),this.value,this.sign!==e.sign)},l.prototype.multiply=function(e){return Y(e)._multiplyBySmall(this)},l.prototype.times=l.prototype.multiply,u.prototype.multiply=function(e){return new u(this.value*Y(e).value)},u.prototype.times=u.prototype.multiply,c.prototype.square=function(){return new c(P(this.value),!1)},l.prototype.square=function(){var e=this.value*this.value;return d(e)?new l(e):new c(P(_(Math.abs(this.value))),!1)},u.prototype.square=function(e){return new u(this.value*this.value)},c.prototype.divmod=function(e){var t=k(this,e);return{quotient:t[0],remainder:t[1]}},u.prototype.divmod=l.prototype.divmod=c.prototype.divmod,c.prototype.divide=function(e){return k(this,e)[0]},u.prototype.over=u.prototype.divide=function(e){return new u(this.value/Y(e).value)},l.prototype.over=l.prototype.divide=c.prototype.over=c.prototype.divide,c.prototype.mod=function(e){return k(this,e)[1]},u.prototype.mod=u.prototype.remainder=function(e){return new u(this.value%Y(e).value)},l.prototype.remainder=l.prototype.mod=c.prototype.remainder=c.prototype.mod,c.prototype.pow=function(e){var t,n,r,o=Y(e),i=this.value,a=o.value;if(0===a)return s[1];if(0===i)return s[0];if(1===i)return s[1];if(-1===i)return o.isEven()?s[1]:s[-1];if(o.sign)return s[0];if(!o.isSmall)throw new Error("The exponent "+o.toString()+" is too large.");if(this.isSmall&&d(t=Math.pow(i,a)))return new l(m(t));for(n=this,r=s[1];!0&a&&(r=r.times(n),--a),0!==a;)a/=2,n=n.square();return r},l.prototype.pow=c.prototype.pow,u.prototype.pow=function(e){var t=Y(e),n=this.value,r=t.value,o=BigInt(0),i=BigInt(1),a=BigInt(2);if(r===o)return s[1];if(n===o)return s[0];if(n===i)return s[1];if(n===BigInt(-1))return t.isEven()?s[1]:s[-1];if(t.isNegative())return new u(o);for(var c=this,l=s[1];(r&i)===i&&(l=l.times(c),--r),r!==o;)r/=a,c=c.square();return l},c.prototype.modPow=function(e,t){if(e=Y(e),(t=Y(t)).isZero())throw new Error("Cannot take modPow with modulus 0");var n=s[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(s[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return s[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},u.prototype.modPow=l.prototype.modPow=c.prototype.modPow,c.prototype.compareAbs=function(e){var t=Y(e),n=this.value,r=t.value;return t.isSmall?1:I(n,r)},l.prototype.compareAbs=function(e){var t=Y(e),n=Math.abs(this.value),r=t.value;return t.isSmall?n===(r=Math.abs(r))?0:n>r?1:-1:-1},u.prototype.compareAbs=function(e){var t=this.value,n=Y(e).value;return(t=t>=0?t:-t)===(n=n>=0?n:-n)?0:t>n?1:-1},c.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Y(e),n=this.value,r=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:I(n,r)*(this.sign?-1:1)},c.prototype.compareTo=c.prototype.compare,l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Y(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0!==t.sign?n<0?-1:1:n<0?1:-1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=Y(e).value;return t===n?0:t>n?1:-1},u.prototype.compareTo=u.prototype.compare,c.prototype.equals=function(e){return 0===this.compare(e)},u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals=c.prototype.eq=c.prototype.equals,c.prototype.notEquals=function(e){return 0!==this.compare(e)},u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals=c.prototype.neq=c.prototype.notEquals,c.prototype.greater=function(e){return this.compare(e)>0},u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater=c.prototype.gt=c.prototype.greater,c.prototype.lesser=function(e){return this.compare(e)<0},u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser=c.prototype.lt=c.prototype.lesser,c.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals,c.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals,c.prototype.isEven=function(){return 0==(1&this.value[0])},l.prototype.isEven=function(){return 0==(1&this.value)},u.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},c.prototype.isOdd=function(){return 1==(1&this.value[0])},l.prototype.isOdd=function(){return 1==(1&this.value)},u.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},c.prototype.isPositive=function(){return!this.sign},l.prototype.isPositive=function(){return this.value>0},u.prototype.isPositive=l.prototype.isPositive,c.prototype.isNegative=function(){return this.sign},l.prototype.isNegative=function(){return this.value<0},u.prototype.isNegative=l.prototype.isNegative,c.prototype.isUnit=function(){return!1},l.prototype.isUnit=function(){return 1===Math.abs(this.value)},u.prototype.isUnit=function(){return this.abs().value===BigInt(1)},c.prototype.isZero=function(){return!1},l.prototype.isZero=function(){return 0===this.value},u.prototype.isZero=function(){return this.value===BigInt(0)},c.prototype.isDivisibleBy=function(e){var t=Y(e);return!t.isZero()&&(!!t.isUnit()||(0===t.compareAbs(2)?this.isEven():this.mod(t).isZero()))},u.prototype.isDivisibleBy=l.prototype.isDivisibleBy=c.prototype.isDivisibleBy,c.prototype.isPrime=function(t){var n=O(this);if(n!==e)return n;var r=this.abs(),i=r.bitLength();if(i<=64)return x(r,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var a=Math.log(2)*i.toJSNumber(),s=Math.ceil(!0===t?2*Math.pow(a,2):a),c=[],l=0;l<s;l++)c.push(o(l+2));return x(r,c)},u.prototype.isPrime=l.prototype.isPrime=c.prototype.isPrime,c.prototype.isProbablePrime=function(t,n){var r=O(this);if(r!==e)return r;for(var i=this.abs(),a=t===e?5:t,s=[],c=0;c<a;c++)s.push(o.randBetween(2,i.minus(2),n));return x(i,s)},u.prototype.isProbablePrime=l.prototype.isProbablePrime=c.prototype.isProbablePrime,c.prototype.modInv=function(e){for(var t,n,r,i=o.zero,a=o.one,s=Y(e),c=this.abs();!c.isZero();)t=s.divide(c),n=i,r=s,i=a,s=c,a=n.subtract(t.multiply(a)),c=r.subtract(t.multiply(c));if(!s.isUnit())throw new Error(this.toString()+" and "+e.toString()+" are not co-prime");return-1===i.compare(0)&&(i=i.add(e)),this.isNegative()?i.negate():i},u.prototype.modInv=l.prototype.modInv=c.prototype.modInv,c.prototype.next=function(){var e=this.value;return this.sign?w(e,1,this.sign):new c(y(e,1),this.sign)},l.prototype.next=function(){var e=this.value;return e+1<n?new l(e+1):new c(r,!1)},u.prototype.next=function(){return new u(this.value+BigInt(1))},c.prototype.prev=function(){var e=this.value;return this.sign?new c(y(e,1),!0):w(e,1,this.sign)},l.prototype.prev=function(){var e=this.value;return e-1>-n?new l(e-1):new c(r,!0)},u.prototype.prev=function(){return new u(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var M=R.length,L=R[M-1];function N(e){return Math.abs(e)<=t}function B(e,t,n){t=Y(t);for(var r=e.isNegative(),i=t.isNegative(),a=r?e.not():e,s=i?t.not():t,c=0,l=0,u=null,d=null,_=[];!a.isZero()||!s.isZero();)c=(u=k(a,L))[1].toJSNumber(),r&&(c=L-1-c),l=(d=k(s,L))[1].toJSNumber(),i&&(l=L-1-l),a=u[0],s=d[0],_.push(n(c,l));for(var p=0!==n(r?1:0,i?1:0)?o(-1):o(0),h=_.length-1;h>=0;h-=1)p=p.multiply(L).add(o(_[h]));return p}c.prototype.shiftLeft=function(e){var t=Y(e).toJSNumber();if(!N(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=M;)n=n.multiply(L),t-=M-1;return n.multiply(R[t])},u.prototype.shiftLeft=l.prototype.shiftLeft=c.prototype.shiftLeft,c.prototype.shiftRight=function(e){var t,n=Y(e).toJSNumber();if(!N(n))throw new Error(String(n)+" is too large for shifting.");if(n<0)return this.shiftLeft(-n);for(var r=this;n>=M;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;r=(t=k(r,L))[1].isNegative()?t[0].prev():t[0],n-=M-1}return(t=k(r,R[n]))[1].isNegative()?t[0].prev():t[0]},u.prototype.shiftRight=l.prototype.shiftRight=c.prototype.shiftRight,c.prototype.not=function(){return this.negate().prev()},u.prototype.not=l.prototype.not=c.prototype.not,c.prototype.and=function(e){return B(this,e,(function(e,t){return e&t}))},u.prototype.and=l.prototype.and=c.prototype.and,c.prototype.or=function(e){return B(this,e,(function(e,t){return e|t}))},u.prototype.or=l.prototype.or=c.prototype.or,c.prototype.xor=function(e){return B(this,e,(function(e,t){return e^t}))},u.prototype.xor=l.prototype.xor=c.prototype.xor;var U=1<<30;function F(e){var n=e.value,r="number"==typeof n?n|U:"bigint"==typeof n?n|BigInt(U):n[0]+n[1]*t|1073758208;return r&-r}function W(e,t){if(t.compareTo(e)<=0){var n=W(e,t.square(t)),r=n.p,i=n.e,a=r.multiply(t);return a.compareTo(e)<=0?{p:a,e:2*i+1}:{p:r,e:2*i}}return{p:o(1),e:0}}function j(e,t){return e=Y(e),t=Y(t),e.greater(t)?e:t}function V(e,t){return e=Y(e),t=Y(t),e.lesser(t)?e:t}function H(e,t){if(e=Y(e).abs(),t=Y(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n,r,o=s[1];e.isEven()&&t.isEven();)n=V(F(e),F(t)),e=e.divide(n),t=t.divide(n),o=o.multiply(n);for(;e.isEven();)e=e.divide(F(e));do{for(;t.isEven();)t=t.divide(F(t));e.greater(t)&&(r=t,t=e,e=r),t=t.subtract(e)}while(!t.isZero());return o.isUnit()?e:e.multiply(o)}c.prototype.bitLength=function(){var e=this;return e.compareTo(o(0))<0&&(e=e.negate().subtract(o(1))),0===e.compareTo(o(0))?o(0):o(W(e,o(2)).e).add(o(1))},u.prototype.bitLength=l.prototype.bitLength=c.prototype.bitLength;var K=function(e,t,n,r){n=n||i,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var o,a=e.length,s=Math.abs(t),c={};for(o=0;o<n.length;o++)c[n[o]]=o;for(o=0;o<a;o++){if("-"!==(d=e[o])&&(d in c&&c[d]>=s)){if("1"===d&&1===s)continue;throw new Error(d+" is not a valid digit in base "+t+".")}}t=Y(t);var l=[],u="-"===e[0];for(o=u?1:0;o<e.length;o++){var d;if((d=e[o])in c)l.push(Y(c[d]));else{if("<"!==d)throw new Error(d+" is not a valid character");var _=o;do{o++}while(">"!==e[o]&&o<e.length);l.push(Y(e.slice(_+1,o)))}}return G(l,t,u)};function G(e,t,n){var r,o=s[0],i=s[1];for(r=e.length-1;r>=0;r--)o=o.add(e[r].times(i)),i=i.times(t);return n?o.negate():o}function z(e,t){if((t=o(t)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var n=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return n.unshift([1]),{value:[].concat.apply([],n),isNegative:!1}}var r=!1;if(e.isNegative()&&t.isPositive()&&(r=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:r};for(var i,a=[],s=e;s.isNegative()||s.compareAbs(t)>=0;){i=s.divmod(t),s=i.quotient;var c=i.remainder;c.isNegative()&&(c=t.minus(c).abs(),s=s.next()),a.push(c.toJSNumber())}return a.push(s.toJSNumber()),{value:a.reverse(),isNegative:r}}function q(e,t,n){var r=z(e,t);return(r.isNegative?"-":"")+r.value.map((function(e){return function(e,t){return e<(t=t||i).length?t[e]:"<"+e+">"}(e,n)})).join("")}function $(e){if(d(+e)){var t=+e;if(t===m(t))return a?new u(BigInt(t)):new l(t);throw new Error("Invalid integer: "+e)}var n="-"===e[0];n&&(e=e.slice(1));var r=e.split(/e/i);if(r.length>2)throw new Error("Invalid integer: "+r.join("e"));if(2===r.length){var o=r[1];if("+"===o[0]&&(o=o.slice(1)),(o=+o)!==m(o)||!d(o))throw new Error("Invalid integer: "+o+" is not a valid exponent.");var i=r[0],s=i.indexOf(".");if(s>=0&&(o-=i.length-s-1,i=i.slice(0,s)+i.slice(s+1)),o<0)throw new Error("Cannot include negative exponent part for integers");e=i+=new Array(o+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(a)return new u(BigInt(n?"-"+e:e));for(var _=[],p=e.length,f=p-7;p>0;)_.push(+e.slice(f,p)),(f-=7)<0&&(f=0),p-=7;return h(_),new c(_,n)}function Y(e){return"number"==typeof e?function(e){if(a)return new u(BigInt(e));if(d(e)){if(e!==m(e))throw new Error(e+" is not an integer.");return new l(e)}return $(e.toString())}(e):"string"==typeof e?$(e):"bigint"==typeof e?new u(e):e}c.prototype.toArray=function(e){return z(this,e)},l.prototype.toArray=function(e){return z(this,e)},u.prototype.toArray=function(e){return z(this,e)},c.prototype.toString=function(t,n){if(t===e&&(t=10),10!==t)return q(this,t,n);for(var r,o=this.value,i=o.length,a=String(o[--i]);--i>=0;)r=String(o[i]),a+="0000000".slice(r.length)+r;return(this.sign?"-":"")+a},l.prototype.toString=function(t,n){return t===e&&(t=10),10!=t?q(this,t,n):String(this.value)},u.prototype.toString=l.prototype.toString,u.prototype.toJSON=c.prototype.toJSON=l.prototype.toJSON=function(){return this.toString()},c.prototype.valueOf=function(){return parseInt(this.toString(),10)},c.prototype.toJSNumber=c.prototype.valueOf,l.prototype.valueOf=function(){return this.value},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=u.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var Q=0;Q<1e3;Q++)s[Q]=Y(Q),Q>0&&(s[-Q]=Y(-Q));return s.one=s[1],s.zero=s[0],s.minusOne=s[-1],s.max=j,s.min=V,s.gcd=H,s.lcm=function(e,t){return e=Y(e).abs(),t=Y(t).abs(),e.divide(H(e,t)).multiply(t)},s.isInstance=function(e){return e instanceof c||e instanceof l||e instanceof u},s.randBetween=function(e,n,r){e=Y(e),n=Y(n);var o=r||Math.random,i=V(e,n),a=j(e,n).subtract(i).add(1);if(a.isSmall)return i.add(Math.floor(o()*a));for(var c=z(a,t).value,l=[],u=!0,d=0;d<c.length;d++){var _=u?c[d]:t,p=m(o()*_);l.push(p),p<_&&(u=!1)}return i.add(s.fromArray(l,t,!1))},s.fromArray=function(e,t,n){return G(e.map(Y),Y(t||10),n)},s}();e.hasOwnProperty("exports")&&(e.exports=o),void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)},38797:function(e,t,n){var r;!function(o){var i=function(e,t,n){if(!(e instanceof ArrayBuffer||"undefined"!=typeof Buffer&&e instanceof Buffer))throw new Error("Must specify a valid ArrayBuffer or Buffer.");t=t||0,n=n||e.byteLength||e.length,this._view=new Uint8Array(e.buffer||e,t,n),this.bigEndian=!1};i._scratch=new DataView(new ArrayBuffer(8)),Object.defineProperty(i.prototype,"buffer",{get:function(){return"undefined"!=typeof Buffer?Buffer.from(this._view.buffer):this._view.buffer},enumerable:!0,configurable:!1}),Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._view.length},enumerable:!0,configurable:!1}),i.prototype._setBit=function(e,t){t?this._view[e>>3]|=1<<(7&e):this._view[e>>3]&=~(1<<(7&e))},i.prototype.getBits=function(e,t,n){var r=8*this._view.length-e;if(t>r)throw new Error("Cannot get "+t+" bit(s) from offset "+e+", "+r+" available");for(var o=0,i=0;i<t;){var a=t-i,s=7&e,c=this._view[e>>3],l=Math.min(a,8-s);this.bigEndian?(o<<=l,o|=c>>8-l-s&~(255<<l)):o|=(c>>s&~(255<<l))<<i,e+=l,i+=l}return n?(32!==t&&o&1<<t-1&&(o|=-1^(1<<t)-1),o):o>>>0},i.prototype.setBits=function(e,t,n){var r=8*this._view.length-e;if(n>r)throw new Error("Cannot set "+n+" bit(s) from offset "+e+", "+r+" available");for(var o=0;o<n;){var i,a,s,c=n-o,l=7&e,u=e>>3,d=Math.min(c,8-l);if(this.bigEndian){a=t>>n-o-d&(i=~(-1<<d));var _=8-l-d;s=~(i<<_),this._view[u]=this._view[u]&s|a<<_}else a=t&(i=~(255<<d)),t>>=d,s=~(i<<l),this._view[u]=this._view[u]&s|a<<l;e+=d,o+=d}},i.prototype.getBoolean=function(e){return 0!==this.getBits(e,1,!1)},i.prototype.getInt8=function(e){return this.getBits(e,8,!0)},i.prototype.getUint8=function(e){return this.getBits(e,8,!1)},i.prototype.getInt16=function(e){return this.getBits(e,16,!0)},i.prototype.getUint16=function(e){return this.getBits(e,16,!1)},i.prototype.getInt32=function(e){return this.getBits(e,32,!0)},i.prototype.getUint32=function(e){return this.getBits(e,32,!1)},i.prototype.getFloat32=function(e){return i._scratch.setUint32(0,this.getUint32(e)),i._scratch.getFloat32(0)},i.prototype.getFloat64=function(e){return i._scratch.setUint32(0,this.getUint32(e)),i._scratch.setUint32(4,this.getUint32(e+32)),i._scratch.getFloat64(0)},i.prototype.setBoolean=function(e,t){this.setBits(e,t?1:0,1)},i.prototype.setInt8=i.prototype.setUint8=function(e,t){this.setBits(e,t,8)},i.prototype.setInt16=i.prototype.setUint16=function(e,t){this.setBits(e,t,16)},i.prototype.setInt32=i.prototype.setUint32=function(e,t){this.setBits(e,t,32)},i.prototype.setFloat32=function(e,t){i._scratch.setFloat32(0,t),this.setBits(e,i._scratch.getUint32(0),32)},i.prototype.setFloat64=function(e,t){i._scratch.setFloat64(0,t),this.setBits(e,i._scratch.getUint32(0),32),this.setBits(e+32,i._scratch.getUint32(4),32)},i.prototype.getArrayBuffer=function(e,t){for(var n=new Uint8Array(t),r=0;r<t;r++)n[r]=this.getUint8(e+8*r);return n};var a=function(e,t){return function(){if(this._index+t>this._length)throw new Error("Trying to read past the end of the stream");var n=this._view[e](this._index);return this._index+=t,n}},s=function(e,t){return function(n){this._view[e](this._index,n),this._index+=t}};function c(e,t,n){if(0===t)return"";var r=0,o=[],i=!0,a=!!t;for(t||(t=Math.floor((e._length-e._index)/8));r<t;){var s=e.readUint8();if(0===s&&(i=!1,!a))break;i&&o.push(s),r++}var c=String.fromCharCode.apply(null,o);if(!n)return c;try{return decodeURIComponent(escape(c))}catch(e){return c}}var l=function(e,t,n){var r=e instanceof ArrayBuffer||"undefined"!=typeof Buffer&&e instanceof Buffer;if(!(e instanceof i||r))throw new Error("Must specify a valid BitView, ArrayBuffer or Buffer");this._view=r?new i(e,t,n):e,this._index=0,this._startIndex=0,this._length=8*this._view.byteLength};Object.defineProperty(l.prototype,"index",{get:function(){return this._index-this._startIndex},set:function(e){this._index=e+this._startIndex},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"length",{get:function(){return this._length-this._startIndex},set:function(e){this._length=e+this._startIndex},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"bitsLeft",{get:function(){return this._length-this._index},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"byteIndex",{get:function(){return Math.ceil(this._index/8)},set:function(e){this._index=8*e},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"buffer",{get:function(){return this._view.buffer},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"bigEndian",{get:function(){return this._view.bigEndian},set:function(e){this._view.bigEndian=e},enumerable:!0,configurable:!1}),l.prototype.readBits=function(e,t){var n=this._view.getBits(this._index,e,t);return this._index+=e,n},l.prototype.writeBits=function(e,t){this._view.setBits(this._index,e,t),this._index+=t},l.prototype.readBoolean=a("getBoolean",1),l.prototype.readInt8=a("getInt8",8),l.prototype.readUint8=a("getUint8",8),l.prototype.readInt16=a("getInt16",16),l.prototype.readUint16=a("getUint16",16),l.prototype.readInt32=a("getInt32",32),l.prototype.readUint32=a("getUint32",32),l.prototype.readFloat32=a("getFloat32",32),l.prototype.readFloat64=a("getFloat64",64),l.prototype.writeBoolean=s("setBoolean",1),l.prototype.writeInt8=s("setInt8",8),l.prototype.writeUint8=s("setUint8",8),l.prototype.writeInt16=s("setInt16",16),l.prototype.writeUint16=s("setUint16",16),l.prototype.writeInt32=s("setInt32",32),l.prototype.writeUint32=s("setUint32",32),l.prototype.writeFloat32=s("setFloat32",32),l.prototype.writeFloat64=s("setFloat64",64),l.prototype.readASCIIString=function(e){return function(e,t){return c(e,t,!1)}(this,e)},l.prototype.readUTF8String=function(e){return function(e,t){return c(e,t,!0)}(this,e)},l.prototype.writeASCIIString=function(e,t){!function(e,t,n){for(var r=n||t.length+1,o=0;o<r;o++)e.writeUint8(o<t.length?t.charCodeAt(o):0)}(this,e,t)},l.prototype.writeUTF8String=function(e,t){!function(e,t,n){for(var r=function(e){var t,n,r=[];for(t=0;t<e.length;t++)(n=e.charCodeAt(t))<=127?r.push(n):n<=2047?(r.push(n>>6|192),r.push(63&n|128)):n<=65535?(r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)):(r.push(n>>18|240),r.push(n>>12&63|128),r.push(n>>6&63|128),r.push(63&n|128));return r}(t),o=n||r.length+1,i=0;i<o;i++)e.writeUint8(i<r.length?r[i]:0)}(this,e,t)},l.prototype.readBitStream=function(e){var t=new l(this._view);return t._startIndex=this._index,t._index=this._index,t.length=e,this._index+=e,t},l.prototype.writeBitStream=function(e,t){var n;for(t||(t=e.bitsLeft);t>0;)n=Math.min(t,32),this.writeBits(e.readBits(n),n),t-=n},l.prototype.readArrayBuffer=function(e){var t=this._view.getArrayBuffer(this._index,e);return this._index+=8*e,t},l.prototype.writeArrayBuffer=function(e,t){this.writeBitStream(new l(e),8*t)},void 0===(r=function(){return{BitView:i,BitStream:l}}.call(t,n,t,e))||(e.exports=r)}()},24963:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},17722:(e,t,n)=>{var r=n(86314)("unscopables"),o=Array.prototype;null==o[r]&&n(87728)(o,r,{}),e.exports=function(e){o[r][e]=!0}},76793:(e,t,n)=>{"use strict";var r=n(24496)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},83328:e=>{e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},27007:(e,t,n)=>{var r=n(55286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},79315:(e,t,n)=>{var r=n(22110),o=n(10875),i=n(92337);e.exports=function(e){return function(t,n,a){var s,c=r(t),l=o(c.length),u=i(a,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},41488:(e,t,n)=>{var r=n(92032),o=n(86314)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},92032:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},25645:e=>{var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},92811:(e,t,n)=>{"use strict";var r=n(99275),o=n(90681);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},741:(e,t,n)=>{var r=n(24963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},91355:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},67057:(e,t,n)=>{e.exports=!n(74253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},62457:(e,t,n)=>{var r=n(55286),o=n(3816).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},74430:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:(e,t,n)=>{var r=n(47184),o=n(64548),i=n(14682);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),c=i.f,l=0;s.length>l;)c.call(e,a=s[l++])&&t.push(a);return t}},42985:(e,t,n)=>{var r=n(3816),o=n(25645),i=n(87728),a=n(77234),s=n(741),c=function(e,t,n){var l,u,d,_,p=e&c.F,h=e&c.G,f=e&c.S,m=e&c.P,g=e&c.B,v=h?r:f?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?o:o[t]||(o[t]={}),E=y.prototype||(y.prototype={});for(l in h&&(n=t),n)d=((u=!p&&v&&void 0!==v[l])?v:n)[l],_=g&&u?s(d,r):m&&"function"==typeof d?s(Function.call,d):d,v&&a(v,l,d,e&c.U),y[l]!=d&&i(y,l,_),m&&E[l]!=d&&(E[l]=d)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},74253:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},28082:(e,t,n)=>{"use strict";n(18269);var r=n(77234),o=n(87728),i=n(74253),a=n(91355),s=n(86314),c=n(21165),l=s("species"),u=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),d=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var _=s(e),p=!i((function(){var t={};return t[_]=function(){return 7},7!=""[e](t)})),h=p?!i((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[l]=function(){return n}),n[_](""),!t})):void 0;if(!p||!h||"replace"===e&&!u||"split"===e&&!d){var f=/./[_],m=n(a,_,""[e],(function(e,t,n,r,o){return t.exec===c?p&&!o?{done:!0,value:f.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),g=m[0],v=m[1];r(String.prototype,e,g),o(RegExp.prototype,_,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}}},53218:(e,t,n)=>{"use strict";var r=n(27007);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},3531:(e,t,n)=>{var r=n(741),o=n(28851),i=n(86555),a=n(27007),s=n(10875),c=n(69002),l={},u={},d=e.exports=function(e,t,n,d,_){var p,h,f,m,g=_?function(){return e}:c(e),v=r(n,d,t?2:1),y=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(p=s(e.length);p>y;y++)if((m=t?v(a(h=e[y])[0],h[1]):v(e[y]))===l||m===u)return m}else for(f=g.call(e);!(h=f.next()).done;)if((m=o(f,v,h.value,t))===l||m===u)return m};d.BREAK=l,d.RETURN=u},40018:(e,t,n)=>{e.exports=n(3825)("native-function-to-string",Function.toString)},3816:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},79181:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},87728:(e,t,n)=>{var r=n(99275),o=n(90681);e.exports=n(67057)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},40639:(e,t,n)=>{var r=n(3816).document;e.exports=r&&r.documentElement},1734:(e,t,n)=>{e.exports=!n(67057)&&!n(74253)((function(){return 7!=Object.defineProperty(n(62457)("div"),"a",{get:function(){return 7}}).a}))},40266:(e,t,n)=>{var r=n(55286),o=n(27375).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},97242:e=>{e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},49797:(e,t,n)=>{var r=n(92032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},86555:(e,t,n)=>{var r=n(87234),o=n(86314)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},4302:(e,t,n)=>{var r=n(92032);e.exports=Array.isArray||function(e){return"Array"==r(e)}},55286:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},55364:(e,t,n)=>{var r=n(55286),o=n(92032),i=n(86314)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},28851:(e,t,n)=>{var r=n(27007);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},49988:(e,t,n)=>{"use strict";var r=n(42503),o=n(90681),i=n(22943),a={};n(87728)(a,n(86314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},42923:(e,t,n)=>{"use strict";var r=n(4461),o=n(42985),i=n(77234),a=n(87728),s=n(87234),c=n(49988),l=n(22943),u=n(468),d=n(86314)("iterator"),_=!([].keys&&"next"in[].keys()),p="keys",h="values",f=function(){return this};e.exports=function(e,t,n,m,g,v,y){c(n,t,m);var E,w,b,C=function(e){if(!_&&e in P)return P[e];switch(e){case p:case h:return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",T=g==h,D=!1,P=e.prototype,A=P[d]||P["@@iterator"]||g&&P[g],k=A||C(g),I=g?T?C("entries"):k:void 0,O="Array"==t&&P.entries||A;if(O&&(b=u(O.call(new e)))!==Object.prototype&&b.next&&(l(b,S,!0),r||"function"==typeof b[d]||a(b,d,f)),T&&A&&A.name!==h&&(D=!0,k=function(){return A.call(this)}),r&&!y||!_&&!D&&P[d]||a(P,d,k),s[t]=k,s[S]=f,g)if(E={values:T?k:C(h),keys:v?k:C(p),entries:I},y)for(w in E)w in P||i(P,w,E[w]);else o(o.P+o.F*(_||D),t,E);return E}},7462:(e,t,n)=>{var r=n(86314)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},15436:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},87234:e=>{e.exports={}},4461:e=>{e.exports=!1},84728:(e,t,n)=>{var r=n(93953)("meta"),o=n(55286),i=n(79181),a=n(99275).f,s=0,c=Object.isExtensible||function(){return!0},l=!n(74253)((function(){return c(Object.preventExtensions({}))})),u=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";u(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&c(e)&&!i(e,r)&&u(e),e}}},14351:(e,t,n)=>{var r=n(3816),o=n(74193).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(92032)(a);e.exports=function(){var e,t,n,l=function(){var r,o;for(c&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(l)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(l)}}else n=function(){o.call(r,l)};else{var d=!0,_=document.createTextNode("");new i(l).observe(_,{characterData:!0}),n=function(){_.data=d=!d}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},43499:(e,t,n)=>{"use strict";var r=n(24963);function o(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},35345:(e,t,n)=>{"use strict";var r=n(67057),o=n(47184),i=n(64548),a=n(14682),s=n(20508),c=n(49797),l=Object.assign;e.exports=!l||n(74253)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){for(var n=s(e),l=arguments.length,u=1,d=i.f,_=a.f;l>u;)for(var p,h=c(arguments[u++]),f=d?o(h).concat(d(h)):o(h),m=f.length,g=0;m>g;)p=f[g++],r&&!_.call(h,p)||(n[p]=h[p]);return n}:l},42503:(e,t,n)=>{var r=n(27007),o=n(35588),i=n(74430),a=n(69335)("IE_PROTO"),s=function(){},c=function(){var e,t=n(62457)("iframe"),r=i.length;for(t.style.display="none",n(40639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:o(n,t)}},99275:(e,t,n)=>{var r=n(27007),o=n(1734),i=n(21689),a=Object.defineProperty;t.f=n(67057)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},35588:(e,t,n)=>{var r=n(99275),o=n(27007),i=n(47184);e.exports=n(67057)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},18693:(e,t,n)=>{var r=n(14682),o=n(90681),i=n(22110),a=n(21689),s=n(79181),c=n(1734),l=Object.getOwnPropertyDescriptor;t.f=n(67057)?l:function(e,t){if(e=i(e),t=a(t,!0),c)try{return l(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},39327:(e,t,n)=>{var r=n(22110),o=n(20616).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},20616:(e,t,n)=>{var r=n(60189),o=n(74430).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},64548:(e,t)=>{t.f=Object.getOwnPropertySymbols},468:(e,t,n)=>{var r=n(79181),o=n(20508),i=n(69335)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},60189:(e,t,n)=>{var r=n(79181),o=n(22110),i=n(79315)(!1),a=n(69335)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),c=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~i(l,n)||l.push(n));return l}},47184:(e,t,n)=>{var r=n(60189),o=n(74430);e.exports=Object.keys||function(e){return r(e,o)}},14682:(e,t)=>{t.f={}.propertyIsEnumerable},51131:(e,t,n)=>{var r=n(67057),o=n(47184),i=n(22110),a=n(14682).f;e.exports=function(e){return function(t){for(var n,s=i(t),c=o(s),l=c.length,u=0,d=[];l>u;)n=c[u++],r&&!a.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}}},10188:e=>{e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},50094:(e,t,n)=>{var r=n(27007),o=n(55286),i=n(43499);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},90681:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},24408:(e,t,n)=>{var r=n(77234);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},77234:(e,t,n)=>{var r=n(3816),o=n(87728),i=n(79181),a=n(93953)("src"),s=n(40018),c="toString",l=(""+s).split(c);n(25645).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,c,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},27787:(e,t,n)=>{"use strict";var r=n(41488),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},21165:(e,t,n)=>{"use strict";var r,o,i=n(53218),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,l=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),u=void 0!==/()??/.exec("")[1];(l||u)&&(c=function(e){var t,n,r,o,c=this;return u&&(n=new RegExp("^"+c.source+"$(?!\\s)",i.call(c))),l&&(t=c.lastIndex),r=a.call(c,e),l&&r&&(c.lastIndex=c.global?r.index+r[0].length:t),u&&r&&r.length>1&&s.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),e.exports=c},27375:(e,t,n)=>{var r=n(55286),o=n(27007),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(741)(Function.call,n(18693).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},2974:(e,t,n)=>{"use strict";var r=n(3816),o=n(99275),i=n(67057),a=n(86314)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},22943:(e,t,n)=>{var r=n(99275).f,o=n(79181),i=n(86314)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},69335:(e,t,n)=>{var r=n(3825)("keys"),o=n(93953);e.exports=function(e){return r[e]||(r[e]=o(e))}},3825:(e,t,n)=>{var r=n(25645),o=n(3816),i="__core-js_shared__",a=o[i]||(o[i]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(4461)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},58364:(e,t,n)=>{var r=n(27007),o=n(24963),i=n(86314)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},77717:(e,t,n)=>{"use strict";var r=n(74253);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},24496:(e,t,n)=>{var r=n(81467),o=n(91355);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),c=r(n),l=s.length;return c<0||c>=l?e?"":void 0:(i=s.charCodeAt(c))<55296||i>56319||c+1===l||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):i:e?s.slice(c,c+2):a-56320+(i-55296<<10)+65536}}},74193:(e,t,n)=>{var r,o,i,a=n(741),s=n(97242),c=n(40639),l=n(62457),u=n(3816),d=u.process,_=u.setImmediate,p=u.clearImmediate,h=u.MessageChannel,f=u.Dispatch,m=0,g={},v="onreadystatechange",y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},E=function(e){y.call(e.data)};_&&p||(_=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},p=function(e){delete g[e]},"process"==n(92032)(d)?r=function(e){d.nextTick(a(y,e,1))}:f&&f.now?r=function(e){f.now(a(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=E,r=a(i.postMessage,i,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(r=function(e){u.postMessage(e+"","*")},u.addEventListener("message",E,!1)):r=v in l("script")?function(e){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:_,clear:p}},92337:(e,t,n)=>{var r=n(81467),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},81467:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},22110:(e,t,n)=>{var r=n(49797),o=n(91355);e.exports=function(e){return r(o(e))}},10875:(e,t,n)=>{var r=n(81467),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},20508:(e,t,n)=>{var r=n(91355);e.exports=function(e){return Object(r(e))}},21689:(e,t,n)=>{var r=n(55286);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},93953:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},30575:(e,t,n)=>{var r=n(3816).navigator;e.exports=r&&r.userAgent||""},36074:(e,t,n)=>{var r=n(3816),o=n(25645),i=n(4461),a=n(28787),s=n(99275).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},28787:(e,t,n)=>{t.f=n(86314)},86314:(e,t,n)=>{var r=n(3825)("wks"),o=n(93953),i=n(3816).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},69002:(e,t,n)=>{var r=n(41488),o=n(86314)("iterator"),i=n(87234);e.exports=n(25645).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},30522:(e,t,n)=>{"use strict";var r=n(741),o=n(42985),i=n(20508),a=n(28851),s=n(86555),c=n(10875),l=n(92811),u=n(69002);o(o.S+o.F*!n(7462)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,o,d,_=i(e),p="function"==typeof this?this:Array,h=arguments.length,f=h>1?arguments[1]:void 0,m=void 0!==f,g=0,v=u(_);if(m&&(f=r(f,h>2?arguments[2]:void 0,2)),null==v||p==Array&&s(v))for(n=new p(t=c(_.length));t>g;g++)l(n,g,m?f(_[g],g):_[g]);else for(d=v.call(_),n=new p;!(o=d.next()).done;g++)l(n,g,m?a(d,f,[o.value,g],!0):o.value);return n.length=g,n}})},56997:(e,t,n)=>{"use strict";var r=n(17722),o=n(15436),i=n(87234),a=n(22110);e.exports=n(42923)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},20075:(e,t,n)=>{"use strict";var r=n(42985),o=n(24963),i=n(20508),a=n(74253),s=[].sort,c=[1,2,3];r(r.P+r.F*(a((function(){c.sort(void 0)}))||!a((function(){c.sort(null)}))||!n(77717)(s)),"Array",{sort:function(e){return void 0===e?s.call(i(this)):s.call(i(this),o(e))}})},75115:(e,t,n)=>{var r=n(42985);r(r.S+r.F,"Object",{assign:n(35345)})},96253:(e,t,n)=>{"use strict";var r=n(41488),o={};o[n(86314)("toStringTag")]="z",o+""!="[object z]"&&n(77234)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},40851:(e,t,n)=>{"use strict";var r,o,i,a,s=n(4461),c=n(3816),l=n(741),u=n(41488),d=n(42985),_=n(55286),p=n(24963),h=n(83328),f=n(3531),m=n(58364),g=n(74193).set,v=n(14351)(),y=n(43499),E=n(10188),w=n(30575),b=n(50094),C="Promise",S=c.TypeError,T=c.process,D=T&&T.versions,P=D&&D.v8||"",A=c.Promise,k="process"==u(T),I=function(){},O=o=y.f,x=!!function(){try{var e=A.resolve(1),t=(e.constructor={})[n(86314)("species")]=function(e){e(I,I)};return(k||"function"==typeof PromiseRejectionEvent)&&e.then(I)instanceof t&&0!==P.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),R=function(e){var t;return!(!_(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;v((function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,c=t.resolve,l=t.reject,u=t.domain;try{s?(o||(2==e._h&&B(e),e._h=1),!0===s?n=r:(u&&u.enter(),n=s(r),u&&(u.exit(),a=!0)),n===t.promise?l(S("Promise-chain cycle")):(i=R(n))?i.call(n,c,l):c(n)):l(r)}catch(e){u&&!a&&u.exit(),l(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&L(e)}))}},L=function(e){g.call(c,(function(){var t,n,r,o=e._v,i=N(e);if(i&&(t=E((function(){k?T.emit("unhandledRejection",o,e):(n=c.onunhandledrejection)?n({promise:e,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)})),e._h=k||N(e)?2:1),e._a=void 0,i&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},B=function(e){g.call(c,(function(){var t;k?T.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=R(e))?v((function(){var r={_w:n,_d:!1};try{t.call(e,l(F,r,1),l(U,r,1))}catch(e){U.call(r,e)}})):(n._v=e,n._s=1,M(n,!1))}catch(e){U.call({_w:n,_d:!1},e)}}};x||(A=function(e){h(this,A,C,"_h"),p(e),r.call(this);try{e(l(F,this,1),l(U,this,1))}catch(e){U.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(24408)(A.prototype,{then:function(e,t){var n=O(m(this,A));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=k?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=l(F,e,1),this.reject=l(U,e,1)},y.f=O=function(e){return e===A||e===a?new i(e):o(e)}),d(d.G+d.W+d.F*!x,{Promise:A}),n(22943)(A,C),n(2974)(C),a=n(25645).Promise,d(d.S+d.F*!x,C,{reject:function(e){var t=O(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(s||!x),C,{resolve:function(e){return b(s&&this===a?A:this,e)}}),d(d.S+d.F*!(x&&n(7462)((function(e){A.all(e).catch(I)}))),C,{all:function(e){var t=this,n=O(t),r=n.resolve,o=n.reject,i=E((function(){var n=[],i=0,a=1;f(e,!1,(function(e){var s=i++,c=!1;n.push(void 0),a++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=O(t),r=n.reject,o=E((function(){f(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},83946:(e,t,n)=>{var r=n(3816),o=n(40266),i=n(99275).f,a=n(20616).f,s=n(55364),c=n(53218),l=r.RegExp,u=l,d=l.prototype,_=/a/g,p=/a/g,h=new l(_)!==_;if(n(67057)&&(!h||n(74253)((function(){return p[n(86314)("match")]=!1,l(_)!=_||l(p)==p||"/a/i"!=l(_,"i")})))){l=function(e,t){var n=this instanceof l,r=s(e),i=void 0===t;return!n&&r&&e.constructor===l&&i?e:o(h?new u(r&&!i?e.source:e,t):u((r=e instanceof l)?e.source:e,r&&i?c.call(e):t),n?this:d,l)};for(var f=function(e){e in l||i(l,e,{configurable:!0,get:function(){return u[e]},set:function(t){u[e]=t}})},m=a(u),g=0;m.length>g;)f(m[g++]);d.constructor=l,l.prototype=d,n(77234)(r,"RegExp",l)}n(2974)("RegExp")},18269:(e,t,n)=>{"use strict";var r=n(21165);n(42985)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},76774:(e,t,n)=>{n(67057)&&"g"!=/./g.flags&&n(99275).f(RegExp.prototype,"flags",{configurable:!0,get:n(53218)})},21466:(e,t,n)=>{"use strict";var r=n(27007),o=n(10875),i=n(76793),a=n(27787);n(28082)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var c=r(e),l=String(this);if(!c.global)return a(c,l);var u=c.unicode;c.lastIndex=0;for(var d,_=[],p=0;null!==(d=a(c,l));){var h=String(d[0]);_[p]=h,""===h&&(c.lastIndex=i(l,o(c.lastIndex),u)),p++}return 0===p?null:_}]}))},59357:(e,t,n)=>{"use strict";var r=n(27007),o=n(20508),i=n(10875),a=n(81467),s=n(76793),c=n(27787),l=Math.max,u=Math.min,d=Math.floor,_=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;n(28082)("replace",2,(function(e,t,n,h){return[function(r,o){var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=h(n,e,this,t);if(o.done)return o.value;var d=r(e),_=String(this),p="function"==typeof t;p||(t=String(t));var m=d.global;if(m){var g=d.unicode;d.lastIndex=0}for(var v=[];;){var y=c(d,_);if(null===y)break;if(v.push(y),!m)break;""===String(y[0])&&(d.lastIndex=s(_,i(d.lastIndex),g))}for(var E,w="",b=0,C=0;C<v.length;C++){y=v[C];for(var S=String(y[0]),T=l(u(a(y.index),_.length),0),D=[],P=1;P<y.length;P++)D.push(void 0===(E=y[P])?E:String(E));var A=y.groups;if(p){var k=[S].concat(D,T,_);void 0!==A&&k.push(A);var I=String(t.apply(void 0,k))}else I=f(S,_,T,D,A,t);T>=b&&(w+=_.slice(b,T)+I,b=T+S.length)}return w+_.slice(b)}];function f(e,t,r,i,a,s){var c=r+e.length,l=i.length,u=p;return void 0!==a&&(a=o(a),u=_),n.call(s,u,(function(n,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":s=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return n;if(u>l){var _=d(u/10);return 0===_?n:_<=l?void 0===i[_-1]?o.charAt(1):i[_-1]+o.charAt(1):n}s=i[u-1]}return void 0===s?"":s}))}}))},51876:(e,t,n)=>{"use strict";var r=n(55364),o=n(27007),i=n(58364),a=n(76793),s=n(10875),c=n(27787),l=n(21165),u=n(74253),d=Math.min,_=[].push,p=4294967295,h=!u((function(){RegExp(p,"y")}));n(28082)("split",2,(function(e,t,n,u){var f;return f="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);for(var i,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,h=void 0===t?p:t>>>0,f=new RegExp(e.source,u+"g");(i=l.call(f,o))&&!((a=f.lastIndex)>d&&(c.push(o.slice(d,i.index)),i.length>1&&i.index<o.length&&_.apply(c,i.slice(1)),s=i[0].length,d=a,c.length>=h));)f.lastIndex===i.index&&f.lastIndex++;return d===o.length?!s&&f.test("")||c.push(""):c.push(o.slice(d)),c.length>h?c.slice(0,h):c}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):f.call(String(o),n,r)},function(e,t){var r=u(f,e,this,t,f!==n);if(r.done)return r.value;var l=o(e),_=String(this),m=i(l,RegExp),g=l.unicode,v=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(h?"y":"g"),y=new m(h?l:"^(?:"+l.source+")",v),E=void 0===t?p:t>>>0;if(0===E)return[];if(0===_.length)return null===c(y,_)?[_]:[];for(var w=0,b=0,C=[];b<_.length;){y.lastIndex=h?b:0;var S,T=c(y,h?_:_.slice(b));if(null===T||(S=d(s(y.lastIndex+(h?0:b)),_.length))===w)b=a(_,b,g);else{if(C.push(_.slice(w,b)),C.length===E)return C;for(var D=1;D<=T.length-1;D++)if(C.push(T[D]),C.length===E)return C;b=w=S}}return C.push(_.slice(w)),C}]}))},66108:(e,t,n)=>{"use strict";n(76774);var r=n(27007),o=n(53218),i=n(67057),a="toString",s=/./.toString,c=function(e){n(77234)(RegExp.prototype,a,e,!0)};n(74253)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?c((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!i&&e instanceof RegExp?o.call(e):void 0)})):s.name!=a&&c((function(){return s.call(this)}))},95767:(e,t,n)=>{"use strict";var r=n(3816),o=n(79181),i=n(67057),a=n(42985),s=n(77234),c=n(84728).KEY,l=n(74253),u=n(3825),d=n(22943),_=n(93953),p=n(86314),h=n(28787),f=n(36074),m=n(5541),g=n(4302),v=n(27007),y=n(55286),E=n(20508),w=n(22110),b=n(21689),C=n(90681),S=n(42503),T=n(39327),D=n(18693),P=n(64548),A=n(99275),k=n(47184),I=D.f,O=A.f,x=T.f,R=r.Symbol,M=r.JSON,L=M&&M.stringify,N=p("_hidden"),B=p("toPrimitive"),U={}.propertyIsEnumerable,F=u("symbol-registry"),W=u("symbols"),j=u("op-symbols"),V=Object.prototype,H="function"==typeof R&&!!P.f,K=r.QObject,G=!K||!K.prototype||!K.prototype.findChild,z=i&&l((function(){return 7!=S(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=I(V,t);r&&delete V[t],O(e,t,n),r&&e!==V&&O(V,t,r)}:O,q=function(e){var t=W[e]=S(R.prototype);return t._k=e,t},$=H&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},Y=function(e,t,n){return e===V&&Y(j,t,n),v(e),t=b(t,!0),v(n),o(W,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=S(n,{enumerable:C(0,!1)})):(o(e,N)||O(e,N,C(1,{})),e[N][t]=!0),z(e,t,n)):O(e,t,n)},Q=function(e,t){v(e);for(var n,r=m(t=w(t)),o=0,i=r.length;i>o;)Y(e,n=r[o++],t[n]);return e},X=function(e){var t=U.call(this,e=b(e,!0));return!(this===V&&o(W,e)&&!o(j,e))&&(!(t||!o(this,e)||!o(W,e)||o(this,N)&&this[N][e])||t)},J=function(e,t){if(e=w(e),t=b(t,!0),e!==V||!o(W,t)||o(j,t)){var n=I(e,t);return!n||!o(W,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=x(w(e)),r=[],i=0;n.length>i;)o(W,t=n[i++])||t==N||t==c||r.push(t);return r},ee=function(e){for(var t,n=e===V,r=x(n?j:w(e)),i=[],a=0;r.length>a;)!o(W,t=r[a++])||n&&!o(V,t)||i.push(W[t]);return i};H||(s((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=_(arguments.length>0?arguments[0]:void 0),t=function(n){this===V&&t.call(j,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),z(this,e,C(1,n))};return i&&G&&z(V,e,{configurable:!0,set:t}),q(e)}).prototype,"toString",(function(){return this._k})),D.f=J,A.f=Y,n(20616).f=T.f=Z,n(14682).f=X,P.f=ee,i&&!n(4461)&&s(V,"propertyIsEnumerable",X,!0),h.f=function(e){return q(p(e))}),a(a.G+a.W+a.F*!H,{Symbol:R});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=k(p.store),oe=0;re.length>oe;)f(re[oe++]);a(a.S+a.F*!H,"Symbol",{for:function(e){return o(F,e+="")?F[e]:F[e]=R(e)},keyFor:function(e){if(!$(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){G=!0},useSimple:function(){G=!1}}),a(a.S+a.F*!H,"Object",{create:function(e,t){return void 0===t?S(e):Q(S(e),t)},defineProperty:Y,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:Z,getOwnPropertySymbols:ee});var ie=l((function(){P.f(1)}));a(a.S+a.F*ie,"Object",{getOwnPropertySymbols:function(e){return P.f(E(e))}}),M&&a(a.S+a.F*(!H||l((function(){var e=R();return"[null]"!=L([e])||"{}"!=L({a:e})||"{}"!=L(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(y(t)||void 0!==e)&&!$(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!$(t))return t}),r[1]=t,L.apply(M,r)}}),R.prototype[B]||n(87728)(R.prototype,B,R.prototype.valueOf),d(R,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},83276:(e,t,n)=>{var r=n(42985),o=n(51131)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},96409:(e,t,n)=>{var r=n(42985),o=n(51131)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},79665:(e,t,n)=>{n(36074)("asyncIterator")},91181:(e,t,n)=>{for(var r=n(56997),o=n(47184),i=n(77234),a=n(3816),s=n(87728),c=n(87234),l=n(86314),u=l("iterator"),d=l("toStringTag"),_=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(p),f=0;f<h.length;f++){var m,g=h[f],v=p[g],y=a[g],E=y&&y.prototype;if(E&&(E[u]||s(E,u,_),E[d]||s(E,d,g),c[g]=_,v))for(m in r)E[m]||i(E,m,r[m],!0)}},8091:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var n=Object(e),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i=Object.keys(Object(o)),a=0,s=i.length;a<s;a++){var c=i[a],l=Object.getOwnPropertyDescriptor(o,c);void 0!==l&&l.enumerable&&(n[c]=o[c])}}return n}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},20773:(e,t,n)=>{var r="__lodash_hash_undefined__",o="[object Function]",i="[object GeneratorFunction]",a=/^\[object .+?Constructor\]$/,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")();var u,d=Array.prototype,_=Function.prototype,p=Object.prototype,h=l["__core-js_shared__"],f=(u=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",m=_.toString,g=p.hasOwnProperty,v=p.toString,y=RegExp("^"+m.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=d.splice,w=k(l,"Map"),b=k(Object,"create");function C(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function S(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function T(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function P(e){if(!O(e)||(t=e,f&&f in t))return!1;var t,n=function(e){var t=O(e)?v.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?y:a;return n.test(function(e){if(null!=e){try{return m.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function A(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return P(n)?n:void 0}function I(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(I.Cache||T),n}function O(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}C.prototype.clear=function(){this.__data__=b?b(null):{}},C.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},C.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return n===r?void 0:n}return g.call(t,e)?t[e]:void 0},C.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:g.call(t,e)},C.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?r:t,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(e){var t=this.__data__,n=D(t,e);return!(n<0)&&(n==t.length-1?t.pop():E.call(t,n,1),!0)},S.prototype.get=function(e){var t=this.__data__,n=D(t,e);return n<0?void 0:t[n][1]},S.prototype.has=function(e){return D(this.__data__,e)>-1},S.prototype.set=function(e,t){var n=this.__data__,r=D(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},T.prototype.clear=function(){this.__data__={hash:new C,map:new(w||S),string:new C}},T.prototype.delete=function(e){return A(this,e).delete(e)},T.prototype.get=function(e){return A(this,e).get(e)},T.prototype.has=function(e){return A(this,e).has(e)},T.prototype.set=function(e,t){return A(this,e).set(e,t),this},I.Cache=T,e.exports=I},35557:(e,t,n)=>{"use strict";function r(e,t){throw new TypeError(`unexpected tag 0x${e.toString(16)} (${t} expected)`)}function o(e){return 127&e}function i(e){return 0==(128&e)}function a(e){return 224==(224&e)}function s(e){return 160==(224&e)}function c(e){return 144==(240&e)}function l(e){return 128==(240&e)}function u(e,t,n){const r=t.byteLength;if(r<=255)e.putUi8(n),e.putUi8(r);else if(r<=65535)e.putUi8(n+1),e.putUi16(r);else{if(!(r<=4294967295))throw new RangeError("length limit exceeded");e.putUi8(n+2),e.putUi32(r)}e.put(t)}function d(e){const t=e.getUi8();let n;switch(t){case 192:n=0;break;case 196:case 217:n=e.getUi8();break;case 197:case 218:n=e.getUi16();break;case 198:case 219:n=e.getUi32();break;default:s(t)||r(t,"bytes or string"),n=function(e){return 31&e}(t)}return e.get(n)}function _(e,t){t<16?e.putUi8(144|15&t):m(e,220,t)}function p(e,t){const n=e.getUi8(),r=c(n)?function(e){return 15&e}(n):g(e,n,220,"array");if(null!=t&&r!==t)throw new Error(`invalid array header size ${r}`);return r}function h(e,t){t<16?e.putUi8(128|15&t):m(e,222,t)}function f(e,t){const n=e.getUi8(),r=l(n)?function(e){return 15&e}(n):g(e,n,222,"map");if(null!=t&&r!==t)throw new Error(`invalid map header size ${r}`);return r}function m(e,t,n){if(n<=65535)e.putUi8(t),e.putUi16(n);else{if(!(n<=4294967295))throw new RangeError("length limit exceeded");e.putUi8(t+1),e.putUi32(n)}}function g(e,t,n,o){switch(t){case 192:return 0;case n:return e.getUi16();case n+1:return e.getUi32();default:r(t,o)}}n.d(t,{decode:()=>I});const v={enc(e,t){(function(e){switch(typeof e){case"undefined":return y;case"boolean":return E;case"number":return isFinite(e)&&Math.floor(e)===e?e<0?w:b:C;case"string":return T;case"object":return null===e?y:Array.isArray(e)?P:e instanceof Uint8Array||e instanceof ArrayBuffer?S:e instanceof Date?D:k;default:throw new TypeError("unsupported type "+typeof e)}})(t).enc(e,t)},dec:e=>function(e){switch(e){case 192:return y;case 194:case 195:return E;case 208:case 209:case 210:case 211:return w;case 204:case 205:case 206:case 207:return b;case 202:case 203:return C;case 196:case 197:case 198:return S;case 217:case 218:case 219:return T;case 220:case 221:return P;case 222:case 223:return k;case 214:case 215:case 199:return D;default:if(i(e)||a(e))return w;if(s(e))return T;if(c(e))return P;if(l(e))return k;throw new TypeError(`unsupported tag ${e}`)}}(e.peek()).dec(e)},y={enc(e,t){e.putUi8(192)},dec(e){const t=e.getUi8();return 192!==t&&r(t,"nil"),null}},E={enc(e,t){e.putUi8(t?195:194)},dec(e){const t=e.getUi8();switch(t){case 192:case 194:return!1;case 195:return!0;default:r(t,"bool")}}},w={enc(e,t){-128<=t&&t<=127?t>=0?e.putUi8(o(t)):t>-32?e.putUi8(224|31&t):(e.putUi8(208),e.putUi8(t)):-32768<=t&&t<=32767?(e.putI8(209),e.putI16(t)):-2147483648<=t&&t<=2147483647?(e.putI8(210),e.putI32(t)):(e.putI8(211),e.putI64(t))},dec(e){const t=e.getUi8();if(i(t))return function(e){return 127&e}(t);if(a(t))return function(e){return e-256}(t);switch(t){case 192:return 0;case 208:return e.getI8();case 209:return e.getI16();case 210:return e.getI32();case 211:return e.getI64();case 204:return e.getUi8();case 205:return e.getUi16();case 206:return e.getUi32();case 207:return e.getUi64();default:r(t,"int")}}},b={enc(e,t){if(t<0)throw new Error(`not an uint: ${t}`);t<=127?e.putUi8(o(t)):t<=255?(e.putUi8(204),e.putUi8(t)):t<=65535?(e.putUi8(205),e.putUi16(t)):t<=4294967295?(e.putUi8(206),e.putUi32(t)):(e.putUi8(207),e.putUi64(t))},dec(e){const t=w.dec(e);if(t<0)throw new RangeError("uint underflow");return t}},C={enc(e,t){e.putUi8(203),e.putF(t)},dec(e){const t=e.getUi8();switch(t){case 192:return 0;case 202:return e.getF32();case 203:return e.getF64();default:r(t,"float")}}},S={enc(e,t){u(e,t,196)},dec:d},T={enc(e,t){const n=function(e){const t=e.length,n=new Uint8Array(4*t);let r,o=0,i=0;for(;i<t;)r=e.charCodeAt(i++),55296==(64512&r)&&(r=(r<<10)+e.charCodeAt(i++)-56613888),r<128?n[o++]=r:r<2048?(n[o++]=192+(r>>6),n[o++]=128+(63&r)):r<65536?(n[o++]=224+(r>>12),n[o++]=128+(r>>6&63),n[o++]=128+(63&r)):(n[o++]=240+(r>>18),n[o++]=128+(r>>12&63),n[o++]=128+(r>>6&63),n[o++]=128+(63&r));return n.buffer.slice(0,o)}(t);n.byteLength<32?(e.putUi8(160|31&n.byteLength),e.put(n)):u(e,n,217)},dec:e=>function(e){return new TextDecoder("utf-8").decode(e)}(d(e))},D={enc(e,t){const n=t.getTime();e.putUi8(199),e.putUi8(12),e.putI8(-1),e.putUi32(n%1e3*1e6),e.putI64(n/1e3)},dec(e){const t=e.getUi8();switch(t){case 214:if(-1===e.getI8())return new Date(1e3*e.getUi32());break;case 215:if(-1===e.getI8()){const t=e.getUi32(),n=e.getUi32();return new Date(1e3*(n+4294967296*(3&t))+t/4e6)}break;case 199:if(12===e.getUi8()&&-1===e.getI8()){const t=e.getUi32(),n=e.getI64();return new Date(1e3*n+t/1e6)}}r(t,"time")}},P=(A=v,{encHeader:_,decHeader:p,enc(e,t){_(e,t.length),t.forEach((t=>A.enc(e,t)))},dec(e){const t=[];for(let n=p(e);n>0;--n)t.push(A.dec(e));return t}});var A;const k=function(e,t){return{encHeader:h,decHeader:f,enc(n,r){const o=Object.keys(r);h(n,o.length),o.forEach((o=>{e.enc(n,o),t.enc(n,r[o])}))},dec(n){const r={};for(let o=f(n);o>0;--o){r[e.dec(n)]=t.dec(n)}return r}}}(v,v);function I(e,t){return(t||v).dec(function(e){let t=ArrayBuffer.isView(e)?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e),n=0;return{peek:()=>t.getUint8(n),get(e){n+=e;const r=t.byteOffset;return t.buffer.slice(r+n-e,r+n)},getI8:()=>t.getInt8(n++),getI16:()=>(n+=2,t.getInt16(n-2)),getI32:()=>(n+=4,t.getInt32(n-4)),getI64:()=>(n+=8,4294967296*t.getInt32(n-8)+t.getUint32(n-4)),getUi8:()=>t.getUint8(n++),getUi16:()=>(n+=2,t.getUint16(n-2)),getUi32:()=>(n+=4,t.getUint32(n-4)),getUi64:()=>(n+=8,4294967296*t.getUint32(n-8)+t.getUint32(n-4)),getF32:()=>(n+=4,t.getFloat32(n-4)),getF64:()=>(n+=8,t.getFloat64(n-8))}}(e))}},92703:(e,t,n)=>{"use strict";var r=n(50414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},45697:(e,t,n)=>{e.exports=n(92703)()},50414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},64448:(e,t,n)=>{"use strict";var r=n(67294),o=n(25013),i=n(63840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,c={};function l(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},f={};function m(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function E(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!p.call(f,e)||!p.call(h,e)&&(_.test(e)?f[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=60103,C=60106,S=60107,T=60108,D=60114,P=60109,A=60110,k=60112,I=60113,O=60120,x=60115,R=60116,M=60121,L=60128,N=60129,B=60130,U=60131;if("function"==typeof Symbol&&Symbol.for){var F=Symbol.for;b=F("react.element"),C=F("react.portal"),S=F("react.fragment"),T=F("react.strict_mode"),D=F("react.profiler"),P=F("react.provider"),A=F("react.context"),k=F("react.forward_ref"),I=F("react.suspense"),O=F("react.suspense_list"),x=F("react.memo"),R=F("react.lazy"),M=F("react.block"),F("react.scope"),L=F("react.opaque.id"),N=F("react.debug_trace_mode"),B=F("react.offscreen"),U=F("react.legacy_hidden")}var W,j="function"==typeof Symbol&&Symbol.iterator;function V(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=j&&e[j]||e["@@iterator"])?e:null}function H(e){if(void 0===W)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);W=t&&t[1]||""}return"\n"+W+e}var K=!1;function G(e,t){if(!e||K)return"";K=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var o=e.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s])return"\n"+o[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{K=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?H(e):""}function z(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function q(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case C:return"Portal";case D:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case O:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case P:return(e._context.displayName||"Context")+".Provider";case k:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case x:return q(e.type);case M:return q(e._render);case R:t=e._payload,e=e._init;try{return q(e(t))}catch(e){}}return null}function $(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Q(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&E(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?oe(e,t.type,n):t.hasOwnProperty("defaultValue")&&oe(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function oe(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ce(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:$(n)}}function le(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de="http://www.w3.org/1999/xhtml",_e="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var fe,me,ge=(me=function(e,t){if(e.namespaceURI!==_e||"innerHTML"in e)e.innerHTML=t;else{for((fe=fe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return me(e,t)}))}:me);function ve(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ye={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}function be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(ye).forEach((function(e){Ee.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ye[t]=ye[e]}))}));var Ce=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Se(e,t){if(t){if(Ce[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function Te(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function De(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Pe=null,Ae=null,ke=null;function Ie(e){if(e=ro(e)){if("function"!=typeof Pe)throw Error(a(280));var t=e.stateNode;t&&(t=io(t),Pe(e.stateNode,e.type,t))}}function Oe(e){Ae?ke?ke.push(e):ke=[e]:Ae=e}function xe(){if(Ae){var e=Ae,t=ke;if(ke=Ae=null,Ie(e),t)for(e=0;e<t.length;e++)Ie(t[e])}}function Re(e,t){return e(t)}function Me(e,t,n,r,o){return e(t,n,r,o)}function Le(){}var Ne=Re,Be=!1,Ue=!1;function Fe(){null===Ae&&null===ke||(Le(),xe())}function We(e,t){var n=e.stateNode;if(null===n)return null;var r=io(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var je=!1;if(d)try{var Ve={};Object.defineProperty(Ve,"passive",{get:function(){je=!0}}),window.addEventListener("test",Ve,Ve),window.removeEventListener("test",Ve,Ve)}catch(me){je=!1}function He(e,t,n,r,o,i,a,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Ke=!1,Ge=null,ze=!1,qe=null,$e={onError:function(e){Ke=!0,Ge=e}};function Ye(e,t,n,r,o,i,a,s,c){Ke=!1,Ge=null,He.apply($e,arguments)}function Qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Xe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Je(e){if(Qe(e)!==e)throw Error(a(188))}function Ze(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Qe(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Je(o),e;if(i===r)return Je(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s){for(c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,ot,it=!1,at=[],st=null,ct=null,lt=null,ut=new Map,dt=new Map,_t=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,o){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:o,targetContainers:[r]}}function ft(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":ct=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function mt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e=ht(t,n,r,o,i),null!==t&&(null!==(t=ro(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function gt(e){var t=no(e.target);if(null!==t){var n=Qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Xe(n)))return e.blockedOn=t,void ot(e.lanePriority,(function(){i.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function vt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ro(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function yt(e,t,n){vt(e)&&n.delete(t)}function Et(){for(it=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ro(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&vt(st)&&(st=null),null!==ct&&vt(ct)&&(ct=null),null!==lt&&vt(lt)&&(lt=null),ut.forEach(yt),dt.forEach(yt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Et)))}function bt(e){function t(t){return wt(t,e)}if(0<at.length){wt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&wt(st,e),null!==ct&&wt(ct,e),null!==lt&&wt(lt,e),ut.forEach(t),dt.forEach(t),n=0;n<_t.length;n++)(r=_t[n]).blockedOn===e&&(r.blockedOn=null);for(;0<_t.length&&null===(n=_t[0]).blockedOn;)gt(n),null===n.blockedOn&&_t.shift()}function Ct(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var St={animationend:Ct("Animation","AnimationEnd"),animationiteration:Ct("Animation","AnimationIteration"),animationstart:Ct("Animation","AnimationStart"),transitionend:Ct("Transition","TransitionEnd")},Tt={},Dt={};function Pt(e){if(Tt[e])return Tt[e];if(!St[e])return e;var t,n=St[e];for(t in n)if(n.hasOwnProperty(t)&&t in Dt)return Tt[e]=n[t];return e}d&&(Dt=document.createElement("div").style,"AnimationEvent"in window||(delete St.animationend.animation,delete St.animationiteration.animation,delete St.animationstart.animation),"TransitionEvent"in window||delete St.transitionend.transition);var At=Pt("animationend"),kt=Pt("animationiteration"),It=Pt("animationstart"),Ot=Pt("transitionend"),xt=new Map,Rt=new Map,Mt=["abort","abort",At,"animationEnd",kt,"animationIteration",It,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ot,"transitionEnd","waiting","waiting"];function Lt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];o="on"+(o[0].toUpperCase()+o.slice(1)),Rt.set(r,t),xt.set(r,o),l(o,[r])}}(0,i.unstable_now)();var Nt=8;function Bt(e){if(0!=(1&e))return Nt=15,1;if(0!=(2&e))return Nt=14,2;if(0!=(4&e))return Nt=13,4;var t=24&e;return 0!==t?(Nt=12,t):0!=(32&e)?(Nt=11,32):0!==(t=192&e)?(Nt=10,t):0!=(256&e)?(Nt=9,256):0!==(t=3584&e)?(Nt=8,t):0!=(4096&e)?(Nt=7,4096):0!==(t=4186112&e)?(Nt=6,t):0!==(t=62914560&e)?(Nt=5,t):67108864&e?(Nt=4,67108864):0!=(134217728&e)?(Nt=3,134217728):0!==(t=805306368&e)?(Nt=2,t):0!=(1073741824&e)?(Nt=1,1073741824):(Nt=8,e)}function Ut(e,t){var n=e.pendingLanes;if(0===n)return Nt=0;var r=0,o=0,i=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==i)r=i,o=Nt=15;else if(0!==(i=134217727&n)){var c=i&~a;0!==c?(r=Bt(c),o=Nt):0!==(s&=i)&&(r=Bt(s),o=Nt)}else 0!==(i=n&~a)?(r=Bt(i),o=Nt):0!==s&&(r=Bt(s),o=Nt);if(0===r)return 0;if(r=n&((0>(r=31-Kt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(Bt(t),o<=Nt)return t;Nt=o}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-Kt(t)),r|=e[n],t&=~o;return r}function Ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Wt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=jt(24&~t))?Wt(10,t):e;case 10:return 0===(e=jt(192&~t))?Wt(8,t):e;case 8:return 0===(e=jt(3584&~t))&&(0===(e=jt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=jt(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function jt(e){return e&-e}function Vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Kt(t)]=n}var Kt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Gt(e)/zt|0)|0},Gt=Math.log,zt=Math.LN2;var qt=i.unstable_UserBlockingPriority,$t=i.unstable_runWithPriority,Yt=!0;function Qt(e,t,n,r){Be||Le();var o=Jt,i=Be;Be=!0;try{Me(o,e,t,n,r)}finally{(Be=i)||Fe()}}function Xt(e,t,n,r){$t(qt,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){var o;if(Yt)if((o=0==(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var i=Zt(e,t,n,r);if(null===i)o&&ft(e,r);else{if(o){if(-1<pt.indexOf(e))return e=ht(i,e,t,n,r),void at.push(e);if(function(e,t,n,r,o){switch(t){case"focusin":return st=mt(st,e,t,n,r,o),!0;case"dragenter":return ct=mt(ct,e,t,n,r,o),!0;case"mouseover":return lt=mt(lt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ut.set(i,mt(ut.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,dt.set(i,mt(dt.get(i)||null,e,t,n,r,o)),!0}return!1}(i,e,t,n,r))return;ft(e,r)}Lr(e,t,r,null,n)}}}function Zt(e,t,n,r){var o=De(r);if(null!==(o=no(o))){var i=Qe(o);if(null===i)o=null;else{var a=i.tag;if(13===a){if(null!==(o=Xe(i)))return o;o=null}else if(3===a){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null)}}return Lr(e,t,r,o,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,o="value"in en?en.value:en.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return nn=o.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function cn(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?an:sn,this.isPropagationStopped=sn,this}return o(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var ln,un,dn,_n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=cn(_n),hn=o({},_n,{view:0,detail:0}),fn=cn(hn),mn=o({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dn&&(dn&&"mousemove"===e.type?(ln=e.screenX-dn.screenX,un=e.screenY-dn.screenY):un=ln=0,dn=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:un}}),gn=cn(mn),vn=cn(o({},mn,{dataTransfer:0})),yn=cn(o({},hn,{relatedTarget:0})),En=cn(o({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=o({},_n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=cn(wn),Cn=cn(o({},_n,{data:0})),Sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Dn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Dn[e])&&!!t[e]}function An(){return Pn}var kn=o({},hn,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Tn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),In=cn(kn),On=cn(o({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xn=cn(o({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Rn=cn(o({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=o({},mn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ln=cn(Mn),Nn=[9,13,27,32],Bn=d&&"CompositionEvent"in window,Un=null;d&&"documentMode"in document&&(Un=document.documentMode);var Fn=d&&"TextEvent"in window&&!Un,Wn=d&&(!Bn||Un&&8<Un&&11>=Un),jn=String.fromCharCode(32),Vn=!1;function Hn(e,t){switch(e){case"keyup":return-1!==Nn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Gn=!1;var zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!zn[e.type]:"textarea"===t}function $n(e,t,n,r){Oe(r),0<(t=Br(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Qn=null;function Xn(e){kr(e,0)}function Jn(e){if(X(oo(e)))return e}function Zn(e,t){if("change"===e)return t}var er=!1;if(d){var tr;if(d){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"==typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function or(){Yn&&(Yn.detachEvent("onpropertychange",ir),Qn=Yn=null)}function ir(e){if("value"===e.propertyName&&Jn(Qn)){var t=[];if($n(t,Qn,e,De(e)),e=Xn,Be)e(t);else{Be=!0;try{Re(e,t)}finally{Be=!1,Fe()}}}}function ar(e,t,n){"focusin"===e?(or(),Qn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&or()}function sr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Jn(Qn)}function cr(e,t){if("click"===e)return Jn(t)}function lr(e,t){if("input"===e||"change"===e)return Jn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},dr=Object.prototype.hasOwnProperty;function _r(e,t){if(ur(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!dr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=pr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function mr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var vr=d&&"documentMode"in document&&11>=document.documentMode,yr=null,Er=null,wr=null,br=!1;function Cr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==yr||yr!==J(r)||("selectionStart"in(r=yr)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&_r(wr,r)||(wr=r,0<(r=Br(Er,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}Lt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Lt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Lt(Mt,2);for(var Sr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Tr=0;Tr<Sr.length;Tr++)Rt.set(Sr[Tr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Pr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dr));function Ar(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,i,s,c,l){if(Ye.apply(this,arguments),Ke){if(!Ke)throw Error(a(198));var u=Ge;Ke=!1,Ge=null,ze||(ze=!0,qe=u)}}(r,t,void 0,e),e.currentTarget=null}function kr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==i&&o.isPropagationStopped())break e;Ar(o,s,l),i=c}else for(a=0;a<r.length;a++){if(c=(s=r[a]).instance,l=s.currentTarget,s=s.listener,c!==i&&o.isPropagationStopped())break e;Ar(o,s,l),i=c}}}if(ze)throw e=qe,ze=!1,qe=null,e}function Ir(e,t){var n=ao(t),r=e+"__bubble";n.has(r)||(Mr(t,e,2,!1),n.add(r))}var Or="_reactListening"+Math.random().toString(36).slice(2);function xr(e){e[Or]||(e[Or]=!0,s.forEach((function(t){Pr.has(t)||Rr(t,!1,e,null),Rr(t,!0,e,null)})))}function Rr(e,t,n,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,i=n;if("selectionchange"===e&&9!==n.nodeType&&(i=n.ownerDocument),null!==r&&!t&&Pr.has(e)){if("scroll"!==e)return;o|=2,i=r}var a=ao(i),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(o|=4),Mr(i,e,o,t),a.add(s))}function Mr(e,t,n,r){var o=Rt.get(t);switch(void 0===o?2:o){case 0:o=Qt;break;case 1:o=Xt;break;default:o=Jt}n=o.bind(null,t,n,e),o=void 0,!je||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Lr(e,t,n,r,o){var i=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var c=a.tag;if((3===c||4===c)&&((c=a.stateNode.containerInfo)===o||8===c.nodeType&&c.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=no(s)))return;if(5===(c=a.tag)||6===c){r=i=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Ue)return e(t,n);Ue=!0;try{Ne(e,t,n)}finally{Ue=!1,Fe()}}((function(){var r=i,o=De(n),a=[];e:{var s=xt.get(e);if(void 0!==s){var c=pn,l=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":c=In;break;case"focusin":l="focus",c=yn;break;case"focusout":l="blur",c=yn;break;case"beforeblur":case"afterblur":c=yn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=xn;break;case At:case kt:case It:c=En;break;case Ot:c=Rn;break;case"scroll":c=fn;break;case"wheel":c=Ln;break;case"copy":case"cut":case"paste":c=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=On}var u=0!=(4&t),d=!u&&"scroll"===e,_=u?null!==s?s+"Capture":null:s;u=[];for(var p,h=r;null!==h;){var f=(p=h).stateNode;if(5===p.tag&&null!==f&&(p=f,null!==_&&(null!=(f=We(h,_))&&u.push(Nr(h,f,p)))),d)break;h=h.return}0<u.length&&(s=new c(s,l,null,n,o),a.push({event:s,listeners:u}))}}if(0==(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(l=n.relatedTarget||n.fromElement)||!no(l)&&!l[eo])&&(c||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,c?(c=r,null!==(l=(l=n.relatedTarget||n.toElement)?no(l):null)&&(l!==(d=Qe(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(c=null,l=r),c!==l)){if(u=gn,f="onMouseLeave",_="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(u=On,f="onPointerLeave",_="onPointerEnter",h="pointer"),d=null==c?s:oo(c),p=null==l?s:oo(l),(s=new u(f,h+"leave",c,n,o)).target=d,s.relatedTarget=p,f=null,no(o)===r&&((u=new u(_,h+"enter",l,n,o)).target=p,u.relatedTarget=d,f=u),d=f,c&&l)e:{for(_=l,h=0,p=u=c;p;p=Ur(p))h++;for(p=0,f=_;f;f=Ur(f))p++;for(;0<h-p;)u=Ur(u),h--;for(;0<p-h;)_=Ur(_),p--;for(;h--;){if(u===_||null!==_&&u===_.alternate)break e;u=Ur(u),_=Ur(_)}u=null}else u=null;null!==c&&Fr(a,s,c,u,!1),null!==l&&null!==d&&Fr(a,d,l,u,!0)}if("select"===(c=(s=r?oo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===c&&"file"===s.type)var m=Zn;else if(qn(s))if(er)m=lr;else{m=sr;var g=ar}else(c=s.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=cr);switch(m&&(m=m(e,r))?$n(a,m,n,o):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&oe(s,"number",s.value)),g=r?oo(r):window,e){case"focusin":(qn(g)||"true"===g.contentEditable)&&(yr=g,Er=r,wr=null);break;case"focusout":wr=Er=yr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,Cr(a,n,o);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":Cr(a,n,o)}var v;if(Bn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Gn?Hn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(Wn&&"ko"!==n.locale&&(Gn||"onCompositionStart"!==y?"onCompositionEnd"===y&&Gn&&(v=rn()):(tn="value"in(en=o)?en.value:en.textContent,Gn=!0)),0<(g=Br(r,y)).length&&(y=new Cn(y,e,null,n,o),a.push({event:y,listeners:g}),v?y.data=v:null!==(v=Kn(n))&&(y.data=v))),(v=Fn?function(e,t){switch(e){case"compositionend":return Kn(t);case"keypress":return 32!==t.which?null:(Vn=!0,jn);case"textInput":return(e=t.data)===jn&&Vn?null:e;default:return null}}(e,n):function(e,t){if(Gn)return"compositionend"===e||!Bn&&Hn(e,t)?(e=rn(),nn=tn=en=null,Gn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Br(r,"onBeforeInput")).length&&(o=new Cn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=v))}kr(a,t)}))}function Nr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Br(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=We(e,n))&&r.unshift(Nr(e,i,o)),null!=(i=We(e,t))&&r.push(Nr(e,i,o))),e=e.return}return r}function Ur(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Fr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(null!==c&&c===r)break;5===s.tag&&null!==l&&(s=l,o?null!=(c=We(n,i))&&a.unshift(Nr(n,c,s)):o||null!=(c=We(n,i))&&a.push(Nr(n,c,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Wr(){}var jr=null,Vr=null;function Hr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Kr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Gr="function"==typeof setTimeout?setTimeout:void 0,zr="function"==typeof clearTimeout?clearTimeout:void 0;function qr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function $r(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Qr=0;var Xr=Math.random().toString(36).slice(2),Jr="__reactFiber$"+Xr,Zr="__reactProps$"+Xr,eo="__reactContainer$"+Xr,to="__reactEvents$"+Xr;function no(e){var t=e[Jr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[Jr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Jr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ro(e){return!(e=e[Jr]||e[eo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function oo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function io(e){return e[Zr]||null}function ao(e){var t=e[to];return void 0===t&&(t=e[to]=new Set),t}var so=[],co=-1;function lo(e){return{current:e}}function uo(e){0>co||(e.current=so[co],so[co]=null,co--)}function _o(e,t){co++,so[co]=e.current,e.current=t}var po={},ho=lo(po),fo=lo(!1),mo=po;function go(e,t){var n=e.type.contextTypes;if(!n)return po;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vo(e){return null!=(e=e.childContextTypes)}function yo(){uo(fo),uo(ho)}function Eo(e,t,n){if(ho.current!==po)throw Error(a(168));_o(ho,t),_o(fo,n)}function wo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,q(t)||"Unknown",i));return o({},n,r)}function bo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||po,mo=ho.current,_o(ho,e),_o(fo,fo.current),!0}function Co(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=wo(e,t,mo),r.__reactInternalMemoizedMergedChildContext=e,uo(fo),uo(ho),_o(ho,e)):uo(fo),_o(fo,n)}var So=null,To=null,Do=i.unstable_runWithPriority,Po=i.unstable_scheduleCallback,Ao=i.unstable_cancelCallback,ko=i.unstable_shouldYield,Io=i.unstable_requestPaint,Oo=i.unstable_now,xo=i.unstable_getCurrentPriorityLevel,Ro=i.unstable_ImmediatePriority,Mo=i.unstable_UserBlockingPriority,Lo=i.unstable_NormalPriority,No=i.unstable_LowPriority,Bo=i.unstable_IdlePriority,Uo={},Fo=void 0!==Io?Io:function(){},Wo=null,jo=null,Vo=!1,Ho=Oo(),Ko=1e4>Ho?Oo:function(){return Oo()-Ho};function Go(){switch(xo()){case Ro:return 99;case Mo:return 98;case Lo:return 97;case No:return 96;case Bo:return 95;default:throw Error(a(332))}}function zo(e){switch(e){case 99:return Ro;case 98:return Mo;case 97:return Lo;case 96:return No;case 95:return Bo;default:throw Error(a(332))}}function qo(e,t){return e=zo(e),Do(e,t)}function $o(e,t,n){return e=zo(e),Po(e,t,n)}function Yo(){if(null!==jo){var e=jo;jo=null,Ao(e)}Qo()}function Qo(){if(!Vo&&null!==Wo){Vo=!0;var e=0;try{var t=Wo;qo(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Wo=null}catch(t){throw null!==Wo&&(Wo=Wo.slice(e+1)),Po(Ro,Yo),t}finally{Vo=!1}}}var Xo=w.ReactCurrentBatchConfig;function Jo(e,t){if(e&&e.defaultProps){for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Zo=lo(null),ei=null,ti=null,ni=null;function ri(){ni=ti=ei=null}function oi(e){var t=Zo.current;uo(Zo),e.type._context._currentValue=t}function ii(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ai(e,t){ei=e,ni=ti=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Ba=!0),e.firstContext=null)}function si(e,t){if(ni!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(ni=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ti){if(null===ei)throw Error(a(308));ti=t,ei.dependencies={lanes:0,firstContext:t,responders:null}}else ti=ti.next=t;return e._currentValue}var ci=!1;function li(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ui(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function di(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hi(e,t,n,r){var i=e.updateQueue;ci=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,c=i.shared.pending;if(null!==c){i.shared.pending=null;var l=c,u=l.next;l.next=null,null===s?a=u:s.next=u,s=l;var d=e.alternate;if(null!==d){var _=(d=d.updateQueue).lastBaseUpdate;_!==s&&(null===_?d.firstBaseUpdate=u:_.next=u,d.lastBaseUpdate=l)}}if(null!==a){for(_=i.baseState,s=0,d=u=l=null;;){c=a.lane;var p=a.eventTime;if((r&c)===c){null!==d&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,f=a;switch(c=t,p=n,f.tag){case 1:if("function"==typeof(h=f.payload)){_=h.call(p,_,c);break e}_=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(c="function"==typeof(h=f.payload)?h.call(p,_,c):h))break e;_=o({},_,c);break e;case 2:ci=!0}}null!==a.callback&&(e.flags|=32,null===(c=i.effects)?i.effects=[a]:c.push(a))}else p={eventTime:p,lane:c,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(u=d=p,l=_):d=d.next=p,s|=c;if(null===(a=a.next)){if(null===(c=i.shared.pending))break;a=c.next,c.next=null,i.lastBaseUpdate=c,i.shared.pending=null}}null===d&&(l=_),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,js|=s,e.lanes=s,e.memoizedState=_}}function fi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(a(191,o));o.call(r)}}}var mi=(new r.Component).refs;function gi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:o({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var vi={isMounted:function(e){return!!(e=e._reactInternals)&&Qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_c(),o=pc(e),i=di(r,o);i.payload=t,null!=n&&(i.callback=n),_i(e,i),hc(e,o,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_c(),o=pc(e),i=di(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),_i(e,i),hc(e,o,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_c(),r=pc(e),o=di(n,r);o.tag=2,null!=t&&(o.callback=t),_i(e,o),hc(e,r,n)}};function yi(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!_r(n,r)||!_r(o,i))}function Ei(e,t,n){var r=!1,o=po,i=t.contextType;return"object"==typeof i&&null!==i?i=si(i):(o=vo(t)?mo:ho.current,i=(r=null!=(r=t.contextTypes))?go(e,o):po),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=vi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function wi(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vi.enqueueReplaceState(t,t.state,null)}function bi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=mi,li(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=si(i):(i=vo(t)?mo:ho.current,o.context=go(e,i)),hi(e,n,o,r),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(gi(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&vi.enqueueReplaceState(o,o.state,null),hi(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4)}var Ci=Array.isArray;function Si(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=r.refs;t===mi&&(t=r.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Ti(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Di(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=zc(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=Qc(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function l(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Si(e,t,n),r.return=e,r):((r=qc(n.type,n.key,n.props,null,e.mode,r)).ref=Si(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Xc(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=$c(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function _(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Qc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case b:return(n=qc(t.type,t.key,t.props,null,e.mode,n)).ref=Si(e,null,t),n.return=e,n;case C:return(t=Xc(t,e.mode,n)).return=e,t}if(Ci(t)||V(t))return(t=$c(t,e.mode,n,null)).return=e,t;Ti(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case b:return n.key===o?n.type===S?d(e,t,n.props.children,r,o):l(e,t,n,r):null;case C:return n.key===o?u(e,t,n,r):null}if(Ci(n)||V(n))return null!==o?null:d(e,t,n,r,null);Ti(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return c(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case b:return e=e.get(null===r.key?n:r.key)||null,r.type===S?d(t,e,r.props.children,o,r.key):l(t,e,r,o);case C:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Ci(r)||V(r))return d(t,e=e.get(n)||null,r,o,null);Ti(t,r)}return null}function f(o,a,s,c){for(var l=null,u=null,d=a,f=a=0,m=null;null!==d&&f<s.length;f++){d.index>f?(m=d,d=null):m=d.sibling;var g=p(o,d,s[f],c);if(null===g){null===d&&(d=m);break}e&&d&&null===g.alternate&&t(o,d),a=i(g,a,f),null===u?l=g:u.sibling=g,u=g,d=m}if(f===s.length)return n(o,d),l;if(null===d){for(;f<s.length;f++)null!==(d=_(o,s[f],c))&&(a=i(d,a,f),null===u?l=d:u.sibling=d,u=d);return l}for(d=r(o,d);f<s.length;f++)null!==(m=h(d,o,f,s[f],c))&&(e&&null!==m.alternate&&d.delete(null===m.key?f:m.key),a=i(m,a,f),null===u?l=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(o,e)})),l}function m(o,s,c,l){var u=V(c);if("function"!=typeof u)throw Error(a(150));if(null==(c=u.call(c)))throw Error(a(151));for(var d=u=null,f=s,m=s=0,g=null,v=c.next();null!==f&&!v.done;m++,v=c.next()){f.index>m?(g=f,f=null):g=f.sibling;var y=p(o,f,v.value,l);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(o,f),s=i(y,s,m),null===d?u=y:d.sibling=y,d=y,f=g}if(v.done)return n(o,f),u;if(null===f){for(;!v.done;m++,v=c.next())null!==(v=_(o,v.value,l))&&(s=i(v,s,m),null===d?u=v:d.sibling=v,d=v);return u}for(f=r(o,f);!v.done;m++,v=c.next())null!==(v=h(f,o,m,v.value,l))&&(e&&null!==v.alternate&&f.delete(null===v.key?m:v.key),s=i(v,s,m),null===d?u=v:d.sibling=v,d=v);return e&&f.forEach((function(e){return t(o,e)})),u}return function(e,r,i,c){var l="object"==typeof i&&null!==i&&i.type===S&&null===i.key;l&&(i=i.props.children);var u="object"==typeof i&&null!==i;if(u)switch(i.$$typeof){case b:e:{for(u=i.key,l=r;null!==l;){if(l.key===u){if(7===l.tag){if(i.type===S){n(e,l.sibling),(r=o(l,i.props.children)).return=e,e=r;break e}}else if(l.elementType===i.type){n(e,l.sibling),(r=o(l,i.props)).ref=Si(e,l,i),r.return=e,e=r;break e}n(e,l);break}t(e,l),l=l.sibling}i.type===S?((r=$c(i.props.children,e.mode,c,i.key)).return=e,e=r):((c=qc(i.type,i.key,i.props,null,e.mode,c)).ref=Si(e,r,i),c.return=e,e=c)}return s(e);case C:e:{for(l=i.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Xc(i,e.mode,c)).return=e,e=r}return s(e)}if("string"==typeof i||"number"==typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=Qc(i,e.mode,c)).return=e,e=r),s(e);if(Ci(i))return f(e,r,i,c);if(V(i))return m(e,r,i,c);if(u&&Ti(e,i),void 0===i&&!l)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,q(e.type)||"Component"))}return n(e,r)}}var Pi=Di(!0),Ai=Di(!1),ki={},Ii=lo(ki),Oi=lo(ki),xi=lo(ki);function Ri(e){if(e===ki)throw Error(a(174));return e}function Mi(e,t){switch(_o(xi,t),_o(Oi,e),_o(Ii,ki),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}uo(Ii),_o(Ii,t)}function Li(){uo(Ii),uo(Oi),uo(xi)}function Ni(e){Ri(xi.current);var t=Ri(Ii.current),n=he(t,e.type);t!==n&&(_o(Oi,e),_o(Ii,n))}function Bi(e){Oi.current===e&&(uo(Ii),uo(Oi))}var Ui=lo(0);function Fi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wi=null,ji=null,Vi=!1;function Hi(e,t){var n=Kc(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ki(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Gi(e){if(Vi){var t=ji;if(t){var n=t;if(!Ki(e,t)){if(!(t=$r(n.nextSibling))||!Ki(e,t))return e.flags=-1025&e.flags|2,Vi=!1,void(Wi=e);Hi(Wi,n)}Wi=e,ji=$r(t.firstChild)}else e.flags=-1025&e.flags|2,Vi=!1,Wi=e}}function zi(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Wi=e}function qi(e){if(e!==Wi)return!1;if(!Vi)return zi(e),Vi=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Kr(t,e.memoizedProps))for(t=ji;t;)Hi(e,t),t=$r(t.nextSibling);if(zi(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ji=$r(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ji=null}}else ji=Wi?$r(e.stateNode.nextSibling):null;return!0}function $i(){ji=Wi=null,Vi=!1}var Yi=[];function Qi(){for(var e=0;e<Yi.length;e++)Yi[e]._workInProgressVersionPrimary=null;Yi.length=0}var Xi=w.ReactCurrentDispatcher,Ji=w.ReactCurrentBatchConfig,Zi=0,ea=null,ta=null,na=null,ra=!1,oa=!1;function ia(){throw Error(a(321))}function aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function sa(e,t,n,r,o,i){if(Zi=i,ea=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xi.current=null===e||null===e.memoizedState?Ra:Ma,e=n(r,o),oa){i=0;do{if(oa=!1,!(25>i))throw Error(a(301));i+=1,na=ta=null,t.updateQueue=null,Xi.current=La,e=n(r,o)}while(oa)}if(Xi.current=xa,t=null!==ta&&null!==ta.next,Zi=0,na=ta=ea=null,ra=!1,t)throw Error(a(300));return e}function ca(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===na?ea.memoizedState=na=e:na=na.next=e,na}function la(){if(null===ta){var e=ea.alternate;e=null!==e?e.memoizedState:null}else e=ta.next;var t=null===na?ea.memoizedState:na.next;if(null!==t)na=t,ta=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ta=e).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===na?ea.memoizedState=na=e:na=na.next=e}return na}function ua(e,t){return"function"==typeof t?t(e):t}function da(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ta,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var c=s=i=null,l=o;do{var u=l.lane;if((Zi&u)===u)null!==c&&(c=c.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var d={lane:u,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===c?(s=c=d,i=r):c=c.next=d,ea.lanes|=u,js|=u}l=l.next}while(null!==l&&l!==o);null===c?i=r:c.next=s,ur(r,t.memoizedState)||(Ba=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function _a(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{i=e(i,s.action),s=s.next}while(s!==o);ur(i,t.memoizedState)||(Ba=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function pa(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(null!==o?e=o===r:(e=e.mutableReadLanes,(e=(Zi&e)===e)&&(t._workInProgressVersionPrimary=r,Yi.push(t))),e)return n(t._source);throw Yi.push(t),Error(a(350))}function ha(e,t,n,r){var o=Rs;if(null===o)throw Error(a(349));var i=t._getVersion,s=i(t._source),c=Xi.current,l=c.useState((function(){return pa(o,t,n)})),u=l[1],d=l[0];l=na;var _=e.memoizedState,p=_.refs,h=p.getSnapshot,f=_.source;_=_.subscribe;var m=ea;return e.memoizedState={refs:p,source:t,subscribe:r},c.useEffect((function(){p.getSnapshot=n,p.setSnapshot=u;var e=i(t._source);if(!ur(s,e)){e=n(t._source),ur(d,e)||(u(e),e=pc(m),o.mutableReadLanes|=e&o.pendingLanes),e=o.mutableReadLanes,o.entangledLanes|=e;for(var r=o.entanglements,a=e;0<a;){var c=31-Kt(a),l=1<<c;r[c]|=e,a&=~l}}}),[n,t,r]),c.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pc(m);o.mutableReadLanes|=r&o.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),ur(h,n)&&ur(f,t)&&ur(_,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d}).dispatch=u=Oa.bind(null,ea,e),l.queue=e,l.baseQueue=null,d=pa(o,t,n),l.memoizedState=l.baseState=d),d}function fa(e,t,n){return ha(la(),e,t,n)}function ma(e){var t=ca();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e}).dispatch=Oa.bind(null,ea,e),[t.memoizedState,e]}function ga(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ea.updateQueue)?(t={lastEffect:null},ea.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function va(e){return e={current:e},ca().memoizedState=e}function ya(){return la().memoizedState}function Ea(e,t,n,r){var o=ca();ea.flags|=e,o.memoizedState=ga(1|t,n,void 0,void 0===r?null:r)}function wa(e,t,n,r){var o=la();r=void 0===r?null:r;var i=void 0;if(null!==ta){var a=ta.memoizedState;if(i=a.destroy,null!==r&&aa(r,a.deps))return void ga(t,n,i,r)}ea.flags|=e,o.memoizedState=ga(1|t,n,i,r)}function ba(e,t){return Ea(516,4,e,t)}function Ca(e,t){return wa(516,4,e,t)}function Sa(e,t){return wa(4,2,e,t)}function Ta(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Da(e,t,n){return n=null!=n?n.concat([e]):null,wa(4,2,Ta.bind(null,t,e),n)}function Pa(){}function Aa(e,t){var n=la();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ka(e,t){var n=la();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ia(e,t){var n=Go();qo(98>n?98:n,(function(){e(!0)})),qo(97<n?97:n,(function(){var n=Ji.transition;Ji.transition=1;try{e(!1),t()}finally{Ji.transition=n}}))}function Oa(e,t,n){var r=_c(),o=pc(e),i={lane:o,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?i.next=i:(i.next=a.next,a.next=i),t.pending=i,a=e.alternate,e===ea||null!==a&&a===ea)oa=ra=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,c=a(s,n);if(i.eagerReducer=a,i.eagerState=c,ur(c,s))return}catch(e){}hc(e,o,r)}}var xa={readContext:si,useCallback:ia,useContext:ia,useEffect:ia,useImperativeHandle:ia,useLayoutEffect:ia,useMemo:ia,useReducer:ia,useRef:ia,useState:ia,useDebugValue:ia,useDeferredValue:ia,useTransition:ia,useMutableSource:ia,useOpaqueIdentifier:ia,unstable_isNewReconciler:!1},Ra={readContext:si,useCallback:function(e,t){return ca().memoizedState=[e,void 0===t?null:t],e},useContext:si,useEffect:ba,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ea(4,2,Ta.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ea(4,2,e,t)},useMemo:function(e,t){var n=ca();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ca();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Oa.bind(null,ea,e),[r.memoizedState,e]},useRef:va,useState:ma,useDebugValue:Pa,useDeferredValue:function(e){var t=ma(e),n=t[0],r=t[1];return ba((function(){var t=Ji.transition;Ji.transition=1;try{r(e)}finally{Ji.transition=t}}),[e]),n},useTransition:function(){var e=ma(!1),t=e[0];return va(e=Ia.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=ca();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},ha(r,e,t,n)},useOpaqueIdentifier:function(){if(Vi){var e=!1,t=function(e){return{$$typeof:L,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Qr++).toString(36))),Error(a(355))})),n=ma(t)[1];return 0==(2&ea.mode)&&(ea.flags|=516,ga(5,(function(){n("r:"+(Qr++).toString(36))}),void 0,null)),t}return ma(t="r:"+(Qr++).toString(36)),t},unstable_isNewReconciler:!1},Ma={readContext:si,useCallback:Aa,useContext:si,useEffect:Ca,useImperativeHandle:Da,useLayoutEffect:Sa,useMemo:ka,useReducer:da,useRef:ya,useState:function(){return da(ua)},useDebugValue:Pa,useDeferredValue:function(e){var t=da(ua),n=t[0],r=t[1];return Ca((function(){var t=Ji.transition;Ji.transition=1;try{r(e)}finally{Ji.transition=t}}),[e]),n},useTransition:function(){var e=da(ua)[0];return[ya().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return da(ua)[0]},unstable_isNewReconciler:!1},La={readContext:si,useCallback:Aa,useContext:si,useEffect:Ca,useImperativeHandle:Da,useLayoutEffect:Sa,useMemo:ka,useReducer:_a,useRef:ya,useState:function(){return _a(ua)},useDebugValue:Pa,useDeferredValue:function(e){var t=_a(ua),n=t[0],r=t[1];return Ca((function(){var t=Ji.transition;Ji.transition=1;try{r(e)}finally{Ji.transition=t}}),[e]),n},useTransition:function(){var e=_a(ua)[0];return[ya().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return _a(ua)[0]},unstable_isNewReconciler:!1},Na=w.ReactCurrentOwner,Ba=!1;function Ua(e,t,n,r){t.child=null===e?Ai(t,null,n,r):Pi(t,e.child,n,r)}function Fa(e,t,n,r,o){n=n.render;var i=t.ref;return ai(t,o),r=sa(e,t,n,r,i,o),null===e||Ba?(t.flags|=1,Ua(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function Wa(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!=typeof a||Gc(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=qc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,ja(e,t,a,r,o,i))}return a=e.child,0==(o&i)&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:_r)(o,r)&&e.ref===t.ref)?is(e,t,i):(t.flags|=1,(e=zc(a,r)).ref=t.ref,e.return=t,t.child=e)}function ja(e,t,n,r,o,i){if(null!==e&&_r(e.memoizedProps,r)&&e.ref===t.ref){if(Ba=!1,0==(i&o))return t.lanes=e.lanes,is(e,t,i);0!=(16384&e.flags)&&(Ba=!0)}return Ka(e,t,n,r,i)}function Va(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},bc(t,n);else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},bc(t,e),null;t.memoizedState={baseLanes:0},bc(t,null!==i?i.baseLanes:n)}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,bc(t,r);return Ua(e,t,o,n),t.child}function Ha(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ka(e,t,n,r,o){var i=vo(n)?mo:ho.current;return i=go(t,i),ai(t,o),n=sa(e,t,n,r,i,o),null===e||Ba?(t.flags|=1,Ua(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function Ga(e,t,n,r,o){if(vo(n)){var i=!0;bo(t)}else i=!1;if(ai(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Ei(t,n,r),bi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var c=a.context,l=n.contextType;"object"==typeof l&&null!==l?l=si(l):l=go(t,l=vo(n)?mo:ho.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||c!==l)&&wi(t,a,r,l),ci=!1;var _=t.memoizedState;a.state=_,hi(t,r,a,o),c=t.memoizedState,s!==r||_!==c||fo.current||ci?("function"==typeof u&&(gi(t,n,u,r),c=t.memoizedState),(s=ci||yi(t,n,s,r,_,c,l))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=l,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,ui(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Jo(t.type,s),a.props=l,d=t.pendingProps,_=a.context,"object"==typeof(c=n.contextType)&&null!==c?c=si(c):c=go(t,c=vo(n)?mo:ho.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||_!==c)&&wi(t,a,r,c),ci=!1,_=t.memoizedState,a.state=_,hi(t,r,a,o);var h=t.memoizedState;s!==d||_!==h||fo.current||ci?("function"==typeof p&&(gi(t,n,p,r),h=t.memoizedState),(l=ci||yi(t,n,l,r,_,h,c))?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,c),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,c)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=c,r=l):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=256),r=!1)}return za(e,t,n,r,i,o)}function za(e,t,n,r,o,i){Ha(e,t);var a=0!=(64&t.flags);if(!r&&!a)return o&&Co(t,n,!1),is(e,t,i);r=t.stateNode,Na.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Pi(t,e.child,null,i),t.child=Pi(t,null,s,i)):Ua(e,t,s,i),t.memoizedState=r.state,o&&Co(t,n,!0),t.child}function qa(e){var t=e.stateNode;t.pendingContext?Eo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Eo(0,t.context,!1),Mi(e,t.containerInfo)}var $a,Ya,Qa,Xa={dehydrated:null,retryLane:0};function Ja(e,t,n){var r,o=t.pendingProps,i=Ui.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&i)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(i|=1),_o(Ui,1&i),null===e?(void 0!==o.fallback&&Gi(t),e=o.children,i=o.fallback,a?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Xa,e):"number"==typeof o.unstable_expectedLoadTime?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Xa,t.lanes=33554432,e):((n=Yc({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(o=ts(e,t,o.children,o.fallback,n),a=t.child,i=e.child.memoizedState,a.memoizedState=null===i?{baseLanes:n}:{baseLanes:i.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Xa,o):(n=es(e,t,o.children,n),t.memoizedState=null,n))}function Za(e,t,n,r){var o=e.mode,i=e.child;return t={mode:"hidden",children:t},0==(2&o)&&null!==i?(i.childLanes=0,i.pendingProps=t):i=Yc(t,o,0,null),n=$c(n,o,r,null),i.return=e,n.return=e,i.sibling=n,e.child=i,n}function es(e,t,n,r){var o=e.child;return e=o.sibling,n=zc(o,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,o){var i=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&i)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=zc(a,s),null!==e?r=zc(e,r):(r=$c(r,i,o,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ii(e.return,t)}function rs(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.lastEffect=i)}function os(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ua(e,t,r.children,n),0!=(2&(r=Ui.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_o(Ui,r),0==(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Fi(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),rs(t,!1,o,n,i,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Fi(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}rs(t,!0,n,null,i,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function is(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),js|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=zc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=zc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function as(e,t){if(!Vi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return vo(t.type)&&yo(),null;case 3:return Li(),uo(fo),uo(ho),Qi(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(qi(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Bi(t);var i=Ri(xi.current);if(n=t.type,null!==e&&null!=t.stateNode)Ya(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Ri(Ii.current),qi(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jr]=t,r[Zr]=s,n){case"dialog":Ir("cancel",r),Ir("close",r);break;case"iframe":case"object":case"embed":Ir("load",r);break;case"video":case"audio":for(e=0;e<Dr.length;e++)Ir(Dr[e],r);break;case"source":Ir("error",r);break;case"img":case"image":case"link":Ir("error",r),Ir("load",r);break;case"details":Ir("toggle",r);break;case"input":ee(r,s),Ir("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ir("invalid",r);break;case"textarea":ce(r,s),Ir("invalid",r)}for(var l in Se(n,s),e=null,s)s.hasOwnProperty(l)&&(i=s[l],"children"===l?"string"==typeof i?r.textContent!==i&&(e=["children",i]):"number"==typeof i&&r.textContent!==""+i&&(e=["children",""+i]):c.hasOwnProperty(l)&&null!=i&&"onScroll"===l&&Ir("scroll",r));switch(n){case"input":Q(r),re(r,s,!0);break;case"textarea":Q(r),ue(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Wr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(l=9===i.nodeType?i:i.ownerDocument,e===de&&(e=pe(n)),e===de?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Jr]=t,e[Zr]=r,$a(e,t),t.stateNode=e,l=Te(n,r),n){case"dialog":Ir("cancel",e),Ir("close",e),i=r;break;case"iframe":case"object":case"embed":Ir("load",e),i=r;break;case"video":case"audio":for(i=0;i<Dr.length;i++)Ir(Dr[i],e);i=r;break;case"source":Ir("error",e),i=r;break;case"img":case"image":case"link":Ir("error",e),Ir("load",e),i=r;break;case"details":Ir("toggle",e),i=r;break;case"input":ee(e,r),i=Z(e,r),Ir("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=o({},r,{value:void 0}),Ir("invalid",e);break;case"textarea":ce(e,r),i=se(e,r),Ir("invalid",e);break;default:i=r}Se(n,i);var u=i;for(s in u)if(u.hasOwnProperty(s)){var d=u[s];"style"===s?be(e,d):"dangerouslySetInnerHTML"===s?null!=(d=d?d.__html:void 0)&&ge(e,d):"children"===s?"string"==typeof d?("textarea"!==n||""!==d)&&ve(e,d):"number"==typeof d&&ve(e,""+d):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(c.hasOwnProperty(s)?null!=d&&"onScroll"===s&&Ir("scroll",e):null!=d&&E(e,s,d,l))}switch(n){case"input":Q(e),re(e,r,!1);break;case"textarea":Q(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+$(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Wr)}Hr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Qa(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));n=Ri(xi.current),Ri(Ii.current),qi(t)?(r=t.stateNode,n=t.memoizedProps,r[Jr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Jr]=t,t.stateNode=r)}return null;case 13:return uo(Ui),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&qi(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Ui.current)?0===Us&&(Us=3):(0!==Us&&3!==Us||(Us=4),null===Rs||0==(134217727&js)&&0==(134217727&Vs)||vc(Rs,Ls))),(r||n)&&(t.flags|=4),null);case 4:return Li(),null===e&&xr(t.stateNode.containerInfo),null;case 10:return oi(t),null;case 19:if(uo(Ui),null===(r=t.memoizedState))return null;if(s=0!=(64&t.flags),null===(l=r.rendering))if(s)as(r,!1);else{if(0!==Us||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(l=Fi(e))){for(t.flags|=64,as(r,!1),null!==(s=l.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _o(Ui,1&Ui.current|2),t.child}e=e.sibling}null!==r.tail&&Ko()>zs&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Fi(l))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),as(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate&&!Vi)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ko()-r.renderingStartTime>zs&&1073741824!==n&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ko(),n.sibling=null,t=Ui.current,_o(Ui,s?1&t|2:1&t),n):null;case 23:case 24:return Cc(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function cs(e){switch(e.tag){case 1:vo(e.type)&&yo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Li(),uo(fo),uo(ho),Qi(),0!=(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Bi(e),null;case 13:return uo(Ui),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return uo(Ui),null;case 4:return Li(),null;case 10:return oi(e),null;case 23:case 24:return Cc(),null;default:return null}}function ls(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o}}function us(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}$a=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ya=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ri(Ii.current);var a,s=null;switch(n){case"input":i=Z(e,i),r=Z(e,r),s=[];break;case"option":i=ie(e,i),r=ie(e,r),s=[];break;case"select":i=o({},i,{value:void 0}),r=o({},r,{value:void 0}),s=[];break;case"textarea":i=se(e,i),r=se(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Wr)}for(d in Se(n,r),n=null,i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&null!=i[d])if("style"===d){var l=i[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(c.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var u=r[d];if(l=null!=i?i[d]:void 0,r.hasOwnProperty(d)&&u!==l&&(null!=u||null!=l))if("style"===d)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(s=s||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(c.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Ir("scroll",e),s||l===u||(s=[])):"object"==typeof u&&null!==u&&u.$$typeof===L?u.toString():(s=s||[]).push(d,u))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Qa=function(e,t,n,r){n!==r&&(t.flags|=4)};var ds="function"==typeof WeakMap?WeakMap:Map;function _s(e,t,n){(n=di(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Qs||(Qs=!0,Xs=r),us(0,t)},n}function ps(e,t,n){(n=di(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return us(0,t),r(o)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Js?Js=new Set([this]):Js.add(this),us(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"==typeof WeakSet?WeakSet:Set;function fs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Wc(e,t)}else t.current=null}function ms(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Jo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&qr(t.stateNode.containerInfo))}throw Error(a(163))}function gs(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var o=e;r=o.next,0!=(4&(o=o.tag))&&0!=(1&o)&&(Bc(n,e),Nc(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Jo(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&fi(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}fi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Hr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&bt(n)))))}throw Error(a(163))}function vs(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=null!=o&&o.hasOwnProperty("display")?o.display:null,r.style.display=we("display",o)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function ys(e,t){if(To&&"function"==typeof To.onCommitFiberUnmount)try{To.onCommitFiberUnmount(So,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,void 0!==o)if(0!=(4&r))Bc(t,n);else{r=t;try{o()}catch(e){Wc(r,e)}}n=n.next}while(n!==e)}break;case 1:if(fs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Wc(t,e)}break;case 5:fs(t);break;case 4:Ts(e,t)}}function Es(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function bs(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(ve(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Cs(e,n,t):Ss(e,n,t)}function Cs(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Wr));else if(4!==r&&null!==(e=e.child))for(Cs(e,t,n),e=e.sibling;null!==e;)Cs(e,t,n),e=e.sibling}function Ss(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Ss(e,t,n),e=e.sibling;null!==e;)Ss(e,t,n),e=e.sibling}function Ts(e,t){for(var n,r,o=t,i=!1;;){if(!i){i=o.return;e:for(;;){if(null===i)throw Error(a(160));switch(n=i.stateNode,i.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}i=i.return}i=!0}if(5===o.tag||6===o.tag){e:for(var s=e,c=o,l=c;;)if(ys(s,l),null!==l.child&&4!==l.tag)l.child.return=l,l=l.child;else{if(l===c)break e;for(;null===l.sibling;){if(null===l.return||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}r?(s=n,c=o.stateNode,8===s.nodeType?s.parentNode.removeChild(c):s.removeChild(c)):n.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){n=o.stateNode.containerInfo,r=!0,o.child.return=o,o=o.child;continue}}else if(ys(e,o),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(i=!1)}o.sibling.return=o.return,o=o.sibling}}function Ds(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var o=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[Zr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Te(e,o),t=Te(e,r),o=0;o<i.length;o+=2){var s=i[o],c=i[o+1];"style"===s?be(n,c):"dangerouslySetInnerHTML"===s?ge(n,c):"children"===s?ve(n,c):E(n,s,c,t)}switch(e){case"input":ne(n,r);break;case"textarea":le(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(i=r.value)?ae(n,!!r.multiple,i,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,bt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Gs=Ko(),vs(t.child,!0)),void Ps(t);case 19:return void Ps(t);case 23:case 24:return void vs(t,null!==t.memoizedState)}throw Error(a(163))}function Ps(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=Vc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function As(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var ks=Math.ceil,Is=w.ReactCurrentDispatcher,Os=w.ReactCurrentOwner,xs=0,Rs=null,Ms=null,Ls=0,Ns=0,Bs=lo(0),Us=0,Fs=null,Ws=0,js=0,Vs=0,Hs=0,Ks=null,Gs=0,zs=1/0;function qs(){zs=Ko()+500}var $s,Ys=null,Qs=!1,Xs=null,Js=null,Zs=!1,ec=null,tc=90,nc=[],rc=[],oc=null,ic=0,ac=null,sc=-1,cc=0,lc=0,uc=null,dc=!1;function _c(){return 0!=(48&xs)?Ko():-1!==sc?sc:sc=Ko()}function pc(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Go()?1:2;if(0===cc&&(cc=Ws),0!==Xo.transition){0!==lc&&(lc=null!==Ks?Ks.pendingLanes:0),e=cc;var t=4186112&~lc;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Go(),0!=(4&xs)&&98===e?e=Wt(12,cc):e=Wt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),cc),e}function hc(e,t,n){if(50<ic)throw ic=0,ac=null,Error(a(185));if(null===(e=fc(e,t)))return null;Ht(e,t,n),e===Rs&&(Vs|=t,4===Us&&vc(e,Ls));var r=Go();1===t?0!=(8&xs)&&0==(48&xs)?yc(e):(mc(e,n),0===xs&&(qs(),Yo())):(0==(4&xs)||98!==r&&99!==r||(null===oc?oc=new Set([e]):oc.add(e)),mc(e,n)),Ks=e}function fc(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function mc(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var c=31-Kt(s),l=1<<c,u=i[c];if(-1===u){if(0==(l&r)||0!=(l&o)){u=t,Bt(l);var d=Nt;i[c]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);s&=~l}if(r=Ut(e,e===Rs?Ls:0),t=Nt,0===r)null!==n&&(n!==Uo&&Ao(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Uo&&Ao(n)}15===t?(n=yc.bind(null,e),null===Wo?(Wo=[n],jo=Po(Ro,Qo)):Wo.push(n),n=Uo):14===t?n=$o(99,yc.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=$o(n,gc.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function gc(e){if(sc=-1,lc=cc=0,0!=(48&xs))throw Error(a(327));var t=e.callbackNode;if(Lc()&&e.callbackNode!==t)return null;var n=Ut(e,e===Rs?Ls:0);if(0===n)return null;var r=n,o=xs;xs|=16;var i=Dc();for(Rs===e&&Ls===r||(qs(),Sc(e,r));;)try{kc();break}catch(t){Tc(e,t)}if(ri(),Is.current=i,xs=o,null!==Ms?r=0:(Rs=null,Ls=0,r=Us),0!=(Ws&Vs))Sc(e,0);else if(0!==r){if(2===r&&(xs|=64,e.hydrate&&(e.hydrate=!1,qr(e.containerInfo)),0!==(n=Ft(e))&&(r=Pc(e,n))),1===r)throw t=Fs,Sc(e,0),vc(e,n),mc(e,Ko()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:case 5:xc(e);break;case 3:if(vc(e,n),(62914560&n)===n&&10<(r=Gs+500-Ko())){if(0!==Ut(e,0))break;if(((o=e.suspendedLanes)&n)!==n){_c(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Gr(xc.bind(null,e),r);break}xc(e);break;case 4:if(vc(e,n),(4186112&n)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-Kt(n);i=1<<s,(s=r[s])>o&&(o=s),n&=~i}if(n=o,10<(n=(120>(n=Ko()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ks(n/1960))-n)){e.timeoutHandle=Gr(xc.bind(null,e),n);break}xc(e);break;default:throw Error(a(329))}}return mc(e,Ko()),e.callbackNode===t?gc.bind(null,e):null}function vc(e,t){for(t&=~Hs,t&=~Vs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kt(t),r=1<<n;e[n]=-1,t&=~r}}function yc(e){if(0!=(48&xs))throw Error(a(327));if(Lc(),e===Rs&&0!=(e.expiredLanes&Ls)){var t=Ls,n=Pc(e,t);0!=(Ws&Vs)&&(n=Pc(e,t=Ut(e,t)))}else n=Pc(e,t=Ut(e,0));if(0!==e.tag&&2===n&&(xs|=64,e.hydrate&&(e.hydrate=!1,qr(e.containerInfo)),0!==(t=Ft(e))&&(n=Pc(e,t))),1===n)throw n=Fs,Sc(e,0),vc(e,t),mc(e,Ko()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,xc(e),mc(e,Ko()),null}function Ec(e,t){var n=xs;xs|=1;try{return e(t)}finally{0===(xs=n)&&(qs(),Yo())}}function wc(e,t){var n=xs;xs&=-2,xs|=8;try{return e(t)}finally{0===(xs=n)&&(qs(),Yo())}}function bc(e,t){_o(Bs,Ns),Ns|=t,Ws|=t}function Cc(){Ns=Bs.current,uo(Bs)}function Sc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,zr(n)),null!==Ms)for(n=Ms.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yo();break;case 3:Li(),uo(fo),uo(ho),Qi();break;case 5:Bi(r);break;case 4:Li();break;case 13:case 19:uo(Ui);break;case 10:oi(r);break;case 23:case 24:Cc()}n=n.return}Rs=e,Ms=zc(e.current,null),Ls=Ns=Ws=t,Us=0,Fs=null,Hs=Vs=js=0}function Tc(e,t){for(;;){var n=Ms;try{if(ri(),Xi.current=xa,ra){for(var r=ea.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ra=!1}if(Zi=0,na=ta=ea=null,oa=!1,Os.current=null,null===n||null===n.return){Us=1,Fs=t,Ms=null;break}e:{var i=e,a=n.return,s=n,c=t;if(t=Ls,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==c&&"object"==typeof c&&"function"==typeof c.then){var l=c;if(0==(2&s.mode)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!=(1&Ui.current),_=a;do{var p;if(p=13===_.tag){var h=_.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var f=_.memoizedProps;p=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!d)}}if(p){var m=_.updateQueue;if(null===m){var g=new Set;g.add(l),_.updateQueue=g}else m.add(l);if(0==(2&_.mode)){if(_.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var v=di(-1,1);v.tag=2,_i(s,v)}s.lanes|=1;break e}c=void 0,s=t;var y=i.pingCache;if(null===y?(y=i.pingCache=new ds,c=new Set,y.set(l,c)):void 0===(c=y.get(l))&&(c=new Set,y.set(l,c)),!c.has(s)){c.add(s);var E=jc.bind(null,i,l,s);l.then(E,E)}_.flags|=4096,_.lanes=t;break e}_=_.return}while(null!==_);c=Error((q(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Us&&(Us=2),c=ls(c,s),_=a;do{switch(_.tag){case 3:i=c,_.flags|=4096,t&=-t,_.lanes|=t,pi(_,_s(0,i,t));break e;case 1:i=c;var w=_.type,b=_.stateNode;if(0==(64&_.flags)&&("function"==typeof w.getDerivedStateFromError||null!==b&&"function"==typeof b.componentDidCatch&&(null===Js||!Js.has(b)))){_.flags|=4096,t&=-t,_.lanes|=t,pi(_,ps(_,i,t));break e}}_=_.return}while(null!==_)}Oc(n)}catch(e){t=e,Ms===n&&null!==n&&(Ms=n=n.return);continue}break}}function Dc(){var e=Is.current;return Is.current=xa,null===e?xa:e}function Pc(e,t){var n=xs;xs|=16;var r=Dc();for(Rs===e&&Ls===t||Sc(e,t);;)try{Ac();break}catch(t){Tc(e,t)}if(ri(),xs=n,Is.current=r,null!==Ms)throw Error(a(261));return Rs=null,Ls=0,Us}function Ac(){for(;null!==Ms;)Ic(Ms)}function kc(){for(;null!==Ms&&!ko();)Ic(Ms)}function Ic(e){var t=$s(e.alternate,e,Ns);e.memoizedProps=e.pendingProps,null===t?Oc(e):Ms=t,Os.current=null}function Oc(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=ss(n,t,Ns)))return void(Ms=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ns)||0==(4&n.mode)){for(var r=0,o=n.child;null!==o;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=cs(t)))return n.flags&=2047,void(Ms=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ms=t);Ms=t=e}while(null!==t);0===Us&&(Us=5)}function xc(e){var t=Go();return qo(99,Rc.bind(null,e,t)),null}function Rc(e,t){do{Lc()}while(null!==ec);if(0!=(48&xs))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,c=e.expirationTimes;0<i;){var l=31-Kt(i),u=1<<l;o[l]=0,s[l]=-1,c[l]=-1,i&=~u}if(null!==oc&&0==(24&r)&&oc.has(e)&&oc.delete(e),e===Rs&&(Ms=Rs=null,Ls=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(o=xs,xs|=32,Os.current=null,jr=Yt,gr(s=mr())){if("selectionStart"in s)c={start:s.selectionStart,end:s.selectionEnd};else e:if(c=(c=s.ownerDocument)&&c.defaultView||window,(u=c.getSelection&&c.getSelection())&&0!==u.rangeCount){c=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{c.nodeType,l.nodeType}catch(e){c=null;break e}var d=0,_=-1,p=-1,h=0,f=0,m=s,g=null;t:for(;;){for(var v;m!==c||0!==i&&3!==m.nodeType||(_=d+i),m!==l||0!==u&&3!==m.nodeType||(p=d+u),3===m.nodeType&&(d+=m.nodeValue.length),null!==(v=m.firstChild);)g=m,m=v;for(;;){if(m===s)break t;if(g===c&&++h===i&&(_=d),g===l&&++f===u&&(p=d),null!==(v=m.nextSibling))break;g=(m=g).parentNode}m=v}c=-1===_||-1===p?null:{start:_,end:p}}else c=null;c=c||{start:0,end:0}}else c=null;Vr={focusedElem:s,selectionRange:c},Yt=!1,uc=null,dc=!1,Ys=r;do{try{Mc()}catch(e){if(null===Ys)throw Error(a(330));Wc(Ys,e),Ys=Ys.nextEffect}}while(null!==Ys);uc=null,Ys=r;do{try{for(s=e;null!==Ys;){var y=Ys.flags;if(16&y&&ve(Ys.stateNode,""),128&y){var E=Ys.alternate;if(null!==E){var w=E.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&y){case 2:bs(Ys),Ys.flags&=-3;break;case 6:bs(Ys),Ys.flags&=-3,Ds(Ys.alternate,Ys);break;case 1024:Ys.flags&=-1025;break;case 1028:Ys.flags&=-1025,Ds(Ys.alternate,Ys);break;case 4:Ds(Ys.alternate,Ys);break;case 8:Ts(s,c=Ys);var b=c.alternate;Es(c),null!==b&&Es(b)}Ys=Ys.nextEffect}}catch(e){if(null===Ys)throw Error(a(330));Wc(Ys,e),Ys=Ys.nextEffect}}while(null!==Ys);if(w=Vr,E=mr(),y=w.focusedElem,s=w.selectionRange,E!==y&&y&&y.ownerDocument&&fr(y.ownerDocument.documentElement,y)){null!==s&&gr(y)&&(E=s.start,void 0===(w=s.end)&&(w=E),"selectionStart"in y?(y.selectionStart=E,y.selectionEnd=Math.min(w,y.value.length)):(w=(E=y.ownerDocument||document)&&E.defaultView||window).getSelection&&(w=w.getSelection(),c=y.textContent.length,b=Math.min(s.start,c),s=void 0===s.end?b:Math.min(s.end,c),!w.extend&&b>s&&(c=s,s=b,b=c),c=hr(y,b),i=hr(y,s),c&&i&&(1!==w.rangeCount||w.anchorNode!==c.node||w.anchorOffset!==c.offset||w.focusNode!==i.node||w.focusOffset!==i.offset)&&((E=E.createRange()).setStart(c.node,c.offset),w.removeAllRanges(),b>s?(w.addRange(E),w.extend(i.node,i.offset)):(E.setEnd(i.node,i.offset),w.addRange(E))))),E=[];for(w=y;w=w.parentNode;)1===w.nodeType&&E.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof y.focus&&y.focus(),y=0;y<E.length;y++)(w=E[y]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Yt=!!jr,Vr=jr=null,e.current=n,Ys=r;do{try{for(y=e;null!==Ys;){var C=Ys.flags;if(36&C&&gs(y,Ys.alternate,Ys),128&C){E=void 0;var S=Ys.ref;if(null!==S){var T=Ys.stateNode;Ys.tag,E=T,"function"==typeof S?S(E):S.current=E}}Ys=Ys.nextEffect}}catch(e){if(null===Ys)throw Error(a(330));Wc(Ys,e),Ys=Ys.nextEffect}}while(null!==Ys);Ys=null,Fo(),xs=o}else e.current=n;if(Zs)Zs=!1,ec=e,tc=t;else for(Ys=r;null!==Ys;)t=Ys.nextEffect,Ys.nextEffect=null,8&Ys.flags&&((C=Ys).sibling=null,C.stateNode=null),Ys=t;if(0===(r=e.pendingLanes)&&(Js=null),1===r?e===ac?ic++:(ic=0,ac=e):ic=0,n=n.stateNode,To&&"function"==typeof To.onCommitFiberRoot)try{To.onCommitFiberRoot(So,n,void 0,64==(64&n.current.flags))}catch(e){}if(mc(e,Ko()),Qs)throw Qs=!1,e=Xs,Xs=null,e;return 0!=(8&xs)||Yo(),null}function Mc(){for(;null!==Ys;){var e=Ys.alternate;dc||null===uc||(0!=(8&Ys.flags)?et(Ys,uc)&&(dc=!0):13===Ys.tag&&As(e,Ys)&&et(Ys,uc)&&(dc=!0));var t=Ys.flags;0!=(256&t)&&ms(e,Ys),0==(512&t)||Zs||(Zs=!0,$o(97,(function(){return Lc(),null}))),Ys=Ys.nextEffect}}function Lc(){if(90!==tc){var e=97<tc?97:tc;return tc=90,qo(e,Uc)}return!1}function Nc(e,t){nc.push(t,e),Zs||(Zs=!0,$o(97,(function(){return Lc(),null})))}function Bc(e,t){rc.push(t,e),Zs||(Zs=!0,$o(97,(function(){return Lc(),null})))}function Uc(){if(null===ec)return!1;var e=ec;if(ec=null,0!=(48&xs))throw Error(a(331));var t=xs;xs|=32;var n=rc;rc=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===i)throw Error(a(330));Wc(i,e)}}for(n=nc,nc=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var c=o.create;o.destroy=c()}catch(e){if(null===i)throw Error(a(330));Wc(i,e)}}for(c=e.current.firstEffect;null!==c;)e=c.nextEffect,c.nextEffect=null,8&c.flags&&(c.sibling=null,c.stateNode=null),c=e;return xs=t,Yo(),!0}function Fc(e,t,n){_i(e,t=_s(0,t=ls(n,t),1)),t=_c(),null!==(e=fc(e,1))&&(Ht(e,1,t),mc(e,t))}function Wc(e,t){if(3===e.tag)Fc(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Fc(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Js||!Js.has(r))){var o=ps(n,e=ls(t,e),1);if(_i(n,o),o=_c(),null!==(n=fc(n,1)))Ht(n,1,o),mc(n,o);else if("function"==typeof r.componentDidCatch&&(null===Js||!Js.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function jc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=_c(),e.pingedLanes|=e.suspendedLanes&n,Rs===e&&(Ls&n)===n&&(4===Us||3===Us&&(62914560&Ls)===Ls&&500>Ko()-Gs?Sc(e,0):Hs|=n),mc(e,t)}function Vc(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Go()?1:2:(0===cc&&(cc=Ws),0===(t=jt(62914560&~cc))&&(t=4194304))),n=_c(),null!==(e=fc(e,t))&&(Ht(e,t,n),mc(e,n))}function Hc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Kc(e,t,n,r){return new Hc(e,t,n,r)}function Gc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function zc(e,t){var n=e.alternate;return null===n?((n=Kc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qc(e,t,n,r,o,i){var s=2;if(r=e,"function"==typeof e)Gc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case S:return $c(n.children,o,i,t);case N:s=8,o|=16;break;case T:s=8,o|=1;break;case D:return(e=Kc(12,n,t,8|o)).elementType=D,e.type=D,e.lanes=i,e;case I:return(e=Kc(13,n,t,o)).type=I,e.elementType=I,e.lanes=i,e;case O:return(e=Kc(19,n,t,o)).elementType=O,e.lanes=i,e;case B:return Yc(n,o,i,t);case U:return(e=Kc(24,n,t,o)).elementType=U,e.lanes=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case P:s=10;break e;case A:s=9;break e;case k:s=11;break e;case x:s=14;break e;case R:s=16,r=null;break e;case M:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Kc(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function $c(e,t,n,r){return(e=Kc(7,e,r,t)).lanes=n,e}function Yc(e,t,n,r){return(e=Kc(23,e,r,t)).elementType=B,e.lanes=n,e}function Qc(e,t,n){return(e=Kc(6,e,null,t)).lanes=n,e}function Xc(e,t,n){return(t=Kc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jc(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.mutableSourceEagerHydrationData=null}function Zc(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:C,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function el(e,t,n,r){var o=t.current,i=_c(),s=pc(o);e:if(n){t:{if(Qe(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var c=n;do{switch(c.tag){case 3:c=c.stateNode.context;break t;case 1:if(vo(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break t}}c=c.return}while(null!==c);throw Error(a(171))}if(1===n.tag){var l=n.type;if(vo(l)){n=wo(n,l,c);break e}}n=c}else n=po;return null===t.context?t.context=n:t.pendingContext=n,(t=di(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),_i(o,t),hc(o,s,i),s}function tl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rl(e,t){nl(e,t),(e=e.alternate)&&nl(e,t)}function ol(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Jc(e,t,null!=n&&!0===n.hydrate),t=Kc(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,li(t),e[eo]=n.current,xr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var o=(t=r[e])._getVersion;o=o(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}function il(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function al(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"==typeof o){var s=o;o=function(){var e=tl(a);s.call(e)}}el(t,a,e,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ol(e,0,t?{hydrate:!0}:void 0)}(n,r),a=i._internalRoot,"function"==typeof o){var c=o;o=function(){var e=tl(a);c.call(e)}}wc((function(){el(t,a,e,o)}))}return tl(a)}function sl(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!il(t))throw Error(a(200));return Zc(e,t,null,n)}$s=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||fo.current)Ba=!0;else{if(0==(n&r)){switch(Ba=!1,t.tag){case 3:qa(t),$i();break;case 5:Ni(t);break;case 1:vo(t.type)&&bo(t);break;case 4:Mi(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;_o(Zo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Ja(e,t,n):(_o(Ui,1&Ui.current),null!==(t=is(e,t,n))?t.sibling:null);_o(Ui,1&Ui.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return os(e,t,n);t.flags|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),_o(Ui,Ui.current),r)break;return null;case 23:case 24:return t.lanes=0,Va(e,t,n)}return is(e,t,n)}Ba=0!=(16384&e.flags)}else Ba=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=go(t,ho.current),ai(t,n),o=sa(null,t,r,e,o,n),t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,vo(r)){var i=!0;bo(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,li(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&gi(t,r,s,e),o.updater=vi,t.stateNode=o,o._reactInternals=t,bi(t,r,e,n),t=za(null,t,r,!0,i,n)}else t.tag=0,Ua(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return Gc(e)?1:0;if(null!=e){if((e=e.$$typeof)===k)return 11;if(e===x)return 14}return 2}(o),e=Jo(o,e),i){case 0:t=Ka(null,t,o,e,n);break e;case 1:t=Ga(null,t,o,e,n);break e;case 11:t=Fa(null,t,o,e,n);break e;case 14:t=Wa(null,t,o,Jo(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ka(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Ga(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 3:if(qa(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,ui(e,t),hi(t,r,null,n),(r=t.memoizedState.element)===o)$i(),t=is(e,t,n);else{if((i=(o=t.stateNode).hydrate)&&(ji=$r(t.stateNode.containerInfo.firstChild),Wi=t,i=Vi=!0),i){if(null!=(e=o.mutableSourceEagerHydrationData))for(o=0;o<e.length;o+=2)(i=e[o])._workInProgressVersionPrimary=e[o+1],Yi.push(i);for(n=Ai(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Ua(e,t,r,n),$i();t=t.child}return t;case 5:return Ni(t),null===e&&Gi(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,s=o.children,Kr(r,o)?s=null:null!==i&&Kr(r,i)&&(t.flags|=16),Ha(e,t),Ua(e,t,s,n),t.child;case 6:return null===e&&Gi(t),null;case 13:return Ja(e,t,n);case 4:return Mi(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Pi(t,null,r,n):Ua(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Fa(e,t,r,o=t.elementType===r?o:Jo(r,o),n);case 7:return Ua(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ua(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var c=t.type._context;if(_o(Zo,c._currentValue),c._currentValue=i,null!==s)if(c=s.value,0===(i=ur(c,i)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(c,i):1073741823))){if(s.children===o.children&&!fo.current){t=is(e,t,n);break e}}else for(null!==(c=t.child)&&(c.return=t);null!==c;){var l=c.dependencies;if(null!==l){s=c.child;for(var u=l.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&i)){1===c.tag&&((u=di(-1,n&-n)).tag=2,_i(c,u)),c.lanes|=n,null!==(u=c.alternate)&&(u.lanes|=n),ii(c.return,n),l.lanes|=n;break}u=u.next}}else s=10===c.tag&&c.type===t.type?null:c.child;if(null!==s)s.return=c;else for(s=c;null!==s;){if(s===t){s=null;break}if(null!==(c=s.sibling)){c.return=s.return,s=c;break}s=s.return}c=s}Ua(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(i=t.pendingProps).children,ai(t,n),r=r(o=si(o,i.unstable_observedBits)),t.flags|=1,Ua(e,t,r,n),t.child;case 14:return i=Jo(o=t.type,t.pendingProps),Wa(e,t,o,i=Jo(o.type,i),r,n);case 15:return ja(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Jo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,vo(r)?(e=!0,bo(t)):e=!1,ai(t,n),Ei(t,r,o),bi(t,r,o,n),za(null,t,r,!0,e,n);case 19:return os(e,t,n);case 23:case 24:return Va(e,t,n)}throw Error(a(156,t.tag))},ol.prototype.render=function(e){el(e,this._internalRoot,null,null)},ol.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;el(null,e,null,(function(){t[eo]=null}))},tt=function(e){13===e.tag&&(hc(e,4,_c()),rl(e,4))},nt=function(e){13===e.tag&&(hc(e,67108864,_c()),rl(e,67108864))},rt=function(e){if(13===e.tag){var t=_c(),n=pc(e);hc(e,n,t),rl(e,n)}},ot=function(e,t){return t()},Pe=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=io(r);if(!o)throw Error(a(90));X(r),ne(r,o)}}}break;case"textarea":le(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Re=Ec,Me=function(e,t,n,r,o){var i=xs;xs|=4;try{return qo(98,e.bind(null,t,n,r,o))}finally{0===(xs=i)&&(qs(),Yo())}},Le=function(){0==(49&xs)&&(function(){if(null!==oc){var e=oc;oc=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,mc(e,Ko())}))}Yo()}(),Lc())},Ne=function(e,t){var n=xs;xs|=2;try{return e(t)}finally{0===(xs=n)&&(qs(),Yo())}};var cl={Events:[ro,oo,io,Oe,xe,Lc,{current:!1}]},ll={findFiberByHostInstance:no,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},ul={bundleType:ll.bundleType,version:ll.version,rendererPackageName:ll.rendererPackageName,rendererConfig:ll.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:ll.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var dl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dl.isDisabled&&dl.supportsFiber)try{So=dl.inject(ul),To=dl}catch(me){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cl,t.createPortal=sl,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=xs;if(0!=(48&n))return e(t);xs|=1;try{if(e)return qo(99,e.bind(null,t))}finally{xs=n,Yo()}},t.hydrate=function(e,t,n){if(!il(t))throw Error(a(200));return al(null,e,t,!0,n)},t.render=function(e,t,n){if(!il(t))throw Error(a(200));return al(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!il(e))throw Error(a(40));return!!e._reactRootContainer&&(wc((function(){al(null,null,e,!1,(function(){e._reactRootContainer=null,e[eo]=null}))})),!0)},t.unstable_batchedUpdates=Ec,t.unstable_createPortal=function(e,t){return sl(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!il(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return al(e,t,n,!1,r)},t.version="17.0.2"},73935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(64448)},25013:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,c=o(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(c[u]=a[u]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(c[s[d]]=a[s[d]])}}return c}},72408:(e,t,n)=>{"use strict";var r=n(9424),o=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,c=60112;t.Suspense=60113;var l=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;o=d("react.element"),i=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),s=d("react.context"),c=d("react.forward_ref"),t.Suspense=d("react.suspense"),l=d("react.memo"),u=d("react.lazy")}var _="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f={};function m(e,t,n){this.props=e,this.context=t,this.refs=f,this.updater=n||h}function g(){}function v(e,t,n){this.props=e,this.context=t,this.refs=f,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var y=v.prototype=new g;y.constructor=v,r(y,m.prototype),y.isPureReactComponent=!0;var E={current:null},w=Object.prototype.hasOwnProperty,b={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var r,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,r)&&!b.hasOwnProperty(r)&&(i[r]=t[r]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===i[r]&&(i[r]=c[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:E.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var T=/\/+/g;function D(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case o:case i:c=!0}}if(c)return a=a(c=e),e=""===r?"."+D(c,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(T,"$&/")+"/"),P(a,t,n,"",(function(e){return e}))):null!=a&&(S(a)&&(a=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(T,"$&/")+"/")+e)),t.push(a)),1;if(c=0,r=""===r?".":r+":",Array.isArray(e))for(var l=0;l<e.length;l++){var u=r+D(s=e[l],l);c+=P(s,t,n,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_&&e[_]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),l=0;!(s=e.next()).done;)c+=P(s=s.value,t,n,u=r+D(s,l++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return c}function A(e,t,n){if(null==e)return e;var r=[],o=0;return P(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function k(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var I={current:null};function O(){var e=I.current;if(null===e)throw Error(p(321));return e}var x={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error(p(143));return e}},t.Component=m,t.PureComponent=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var i=r({},e.props),a=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=E.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)w.call(t,u)&&!b.hasOwnProperty(u)&&(i[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){l=Array(u);for(var d=0;d<u;d++)l[d]=arguments[d+2];i.children=l}return{$$typeof:o,type:e.type,key:a,ref:s,props:i,_owner:c}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:k}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return O().useCallback(e,t)},t.useContext=function(e,t){return O().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return O().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return O().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return O().useLayoutEffect(e,t)},t.useMemo=function(e,t){return O().useMemo(e,t)},t.useReducer=function(e,t,n){return O().useReducer(e,t,n)},t.useRef=function(e){return O().useRef(e)},t.useState=function(e){return O().useState(e)},t.version="17.0.2"},67294:(e,t,n)=>{"use strict";e.exports=n(72408)},9424:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,c=o(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(c[u]=a[u]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(c[s[d]]=a[s[d]])}}return c}},62539:(e,t,n)=>{"use strict";var r=n(57539);function o(e,t,n,o,i){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(o?o.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},o=function(e,t,n,o){var i=r(e.parameters.apt,n),a=r(t.parameters.apt,o);return i&&a&&i.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(r){for(var i=0;i<t.codecs.length;i++){var a=t.codecs[i];if(r.name.toLowerCase()===a.name.toLowerCase()&&r.clockRate===a.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&a.parameters.apt&&!o(r,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(r.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var o=t.headerExtensions[r];if(e.uri===o.uri){n.headerExtensions.push(o);break}}})),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function s(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function c(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function l(t,n,r,o){var i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var u=function(n){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof r;return o&&(r=[r]),r=r.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)})),delete e.url,e.urls=o?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(u.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(u.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),u.prototype.onicecandidate=null,u.prototype.onaddstream=null,u.prototype.ontrack=null,u.prototype.onremovestream=null,u.prototype.onsignalingstatechange=null,u.prototype.oniceconnectionstatechange=null,u.prototype.onconnectionstatechange=null,u.prototype.onicegatheringstatechange=null,u.prototype.onnegotiationneeded=null,u.prototype.ondatachannel=null,u.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},u.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},u.prototype.getConfiguration=function(){return this._config},u.prototype.getLocalStreams=function(){return this.localStreams},u.prototype.getRemoteStreams=function(){return this.remoteStreams},u.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();r.iceTransport=o.iceTransport,r.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(r),r},u.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(r=this.transceivers[o]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},u.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},u.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},u.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},u.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},u.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},u.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},u.prototype._gather=function(t,n){var o=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),s.component=1,s.ufrag=i.getLocalParameters().usernameFragment;var l=r.writeCandidate(s);a.candidate=Object.assign(a.candidate,r.parseCandidate(l)),a.candidate.candidate=l,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var u=r.getMediaSections(o._localDescription.sdp);u[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=r.getDescription(o._localDescription.sdp)+u.join("");var d=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",a),d&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},u.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},u.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},u.prototype._transceive=function(e,n,o){var a=i(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},u.prototype.setLocalDescription=function(e){var t,n,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=r.parseRtpParameters(e);o.transceivers[t].localCapabilities=n})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(o._remoteDescription.sdp),n=t.shift();var s=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],c=a.iceGatherer,l=a.iceTransport,u=a.dtlsTransport,d=a.localCapabilities,_=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);s&&(h.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===l.state&&l.start(c,p,s?"controlling":"controlled"),"new"===u.state&&u.start(h));var f=i(d,_);o._transceive(a,f.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},u.prototype.setRemoteDescription=function(o){var u=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(c("TypeError",'Unsupported type "'+o.type+'"'));if(!a("setRemoteDescription",o.type,u.signalingState)||u._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+o.type+" in state "+u.signalingState));var d={};u.remoteStreams.forEach((function(e){d[e.id]=e}));var _=[],p=r.splitSections(o.sdp),h=p.shift(),f=r.matchPrefix(h,"a=ice-lite").length>0,m=r.matchPrefix(h,"a=group:BUNDLE ").length>0;u.usingBundle=m;var g=r.matchPrefix(h,"a=ice-options:")[0];return u.canTrickleIceCandidates=!!g&&g.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,c){var l=r.splitLines(a),p=r.getKind(a),g=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,v=l[0].substr(2).split(" ")[2],y=r.getDirection(a,h),E=r.parseMsid(a),w=r.getMid(a)||r.generateIdentifier();if(g||"application"===p&&("DTLS/SCTP"===v||"UDP/DTLS/SCTP"===v))u.transceivers[c]={mid:w,kind:p,protocol:v,rejected:!0};else{var b,C,S,T,D,P,A,k,I;!g&&u.transceivers[c]&&u.transceivers[c].rejected&&(u.transceivers[c]=u._createTransceiver(p,!0));var O,x,R=r.parseRtpParameters(a);g||(O=r.getIceParameters(a,h),(x=r.getDtlsParameters(a,h)).role="client"),A=r.parseRtpEncodingParameters(a);var M=r.parseRtcpParameters(a),L=r.matchPrefix(a,"a=end-of-candidates",h).length>0,N=r.matchPrefix(a,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!g&&m&&c>0&&u.transceivers[c]&&(u._disposeIceAndDtlsTransports(c),u.transceivers[c].iceGatherer=u.transceivers[0].iceGatherer,u.transceivers[c].iceTransport=u.transceivers[0].iceTransport,u.transceivers[c].dtlsTransport=u.transceivers[0].dtlsTransport,u.transceivers[c].rtpSender&&u.transceivers[c].rtpSender.setTransport(u.transceivers[0].dtlsTransport),u.transceivers[c].rtpReceiver&&u.transceivers[c].rtpReceiver.setTransport(u.transceivers[0].dtlsTransport)),"offer"!==o.type||g){if("answer"===o.type&&!g){C=(b=u.transceivers[c]).iceGatherer,S=b.iceTransport,T=b.dtlsTransport,D=b.rtpReceiver,P=b.sendEncodingParameters,k=b.localCapabilities,u.transceivers[c].recvEncodingParameters=A,u.transceivers[c].remoteCapabilities=R,u.transceivers[c].rtcpParameters=M,N.length&&"new"===S.state&&(!f&&!L||m&&0!==c?N.forEach((function(e){s(b.iceTransport,e)})):S.setRemoteCandidates(N)),m&&0!==c||("new"===S.state&&S.start(C,O,"controlling"),"new"===T.state&&T.start(x)),!i(b.localCapabilities,b.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&b.sendEncodingParameters[0].rtx&&delete b.sendEncodingParameters[0].rtx,u._transceive(b,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!D||"sendrecv"!==y&&"sendonly"!==y?delete b.rtpReceiver:(I=D.track,E?(d[E.stream]||(d[E.stream]=new e.MediaStream),n(I,d[E.stream]),_.push([I,D,d[E.stream]])):(d.default||(d.default=new e.MediaStream),n(I,d.default),_.push([I,D,d.default])))}}else{(b=u.transceivers[c]||u._createTransceiver(p)).mid=w,b.iceGatherer||(b.iceGatherer=u._createIceGatherer(c,m)),N.length&&"new"===b.iceTransport.state&&(!L||m&&0!==c?N.forEach((function(e){s(b.iceTransport,e)})):b.iceTransport.setRemoteCandidates(N)),k=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(k.codecs=k.codecs.filter((function(e){return"rtx"!==e.name}))),P=b.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var B,U=!1;if("sendrecv"===y||"sendonly"===y){if(U=!b.rtpReceiver,D=b.rtpReceiver||new e.RTCRtpReceiver(b.dtlsTransport,p),U)I=D.track,E&&"-"===E.stream||(E?(d[E.stream]||(d[E.stream]=new e.MediaStream,Object.defineProperty(d[E.stream],"id",{get:function(){return E.stream}})),Object.defineProperty(I,"id",{get:function(){return E.track}}),B=d[E.stream]):(d.default||(d.default=new e.MediaStream),B=d.default)),B&&(n(I,B),b.associatedRemoteMediaStreams.push(B)),_.push([I,D,B])}else b.rtpReceiver&&b.rtpReceiver.track&&(b.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===b.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),b.associatedRemoteMediaStreams=[]);b.localCapabilities=k,b.remoteCapabilities=R,b.rtpReceiver=D,b.rtcpParameters=M,b.sendEncodingParameters=P,b.recvEncodingParameters=A,u._transceive(u.transceivers[c],!1,U)}}})),void 0===u._dtlsRole&&(u._dtlsRole="offer"===o.type?"active":"passive"),u._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?u._updateSignalingState("have-remote-offer"):u._updateSignalingState("stable"),Object.keys(d).forEach((function(t){var n=d[t];if(n.getTracks().length){if(-1===u.remoteStreams.indexOf(n)){u.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){u._dispatchEvent("addstream",r)}))}_.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&l(u,t,r,[n])}))}})),_.forEach((function(e){e[2]||l(u,e[0],e[1],[])})),e.setTimeout((function(){u&&u.transceivers&&u.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},u.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},u.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},u.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},u.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},u.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},u.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var i=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(i=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(n._createTransceiver("audio"),i--),a>0&&(n._createTransceiver("video"),a--);var l=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(o,i){var a=o.track,s=o.kind,c=o.mid||r.generateIdentifier();o.mid=c,o.iceGatherer||(o.iceGatherer=n._createIceGatherer(i,n.usingBundle));var l=e.RTCRtpSender.getCapabilities(s);t<15019&&(l.codecs=l.codecs.filter((function(e){return"rtx"!==e.name}))),l.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),l.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var u=o.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===s&&!u[0].rtx&&(u[0].rtx={ssrc:u[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,s)),o.localCapabilities=l,o.sendEncodingParameters=u})),"max-compat"!==n._config.bundlePolicy&&(l+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),l+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){l+=o(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),l+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,l+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(l+="a=end-of-candidates\r\n"))}));var u=new e.RTCSessionDescription({type:"offer",sdp:l});return Promise.resolve(u)},u.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,r){if(!(r+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var l=i(e.localCapabilities,e.remoteCapabilities);!l.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,l,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var l=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(l)},u.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,i){if(!n._remoteDescription)return i(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var l=0;l<n.transceivers.length;l++)if(n.transceivers[l].mid===e.sdpMid){a=l;break}var u=n.transceivers[a];if(!u)return i(c("OperationError","Can not add ICE candidate"));if(u.rejected)return o();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return o();if(d.component&&1!==d.component)return o();if((0===a||a>0&&u.iceTransport!==n.transceivers[0].iceTransport)&&!s(u.iceTransport,d))return i(c("OperationError","Can not add ICE candidate"));var _=e.candidate.trim();0===_.indexOf("a=")&&(_=_.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(d.type?_:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);o()}))},u.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw c("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&r.push(e[t].getStats())}))})),Promise.all(r).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])})),t}))}}}));var d=["createOffer","createAnswer"];return d.forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(d=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),u}},60053:(e,t)=>{"use strict";var n,r,o,i;if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,d=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(e){throw setTimeout(d,0),e}};n=function(e){null!==l?setTimeout(n,0,e):(l=e,setTimeout(d,0))},r=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var _=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var h=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof h&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var f=!1,m=null,g=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},i=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,w=E.port2;E.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();y=e+v;try{m(!0,e)?w.postMessage(null):(f=!1,m=null)}catch(e){throw w.postMessage(null),e}}else f=!1},n=function(e){m=e,f||(f=!0,w.postMessage(null))},r=function(e,n){g=_((function(){e(t.unstable_now())}),n)},o=function(){p(g),g=-1}}function b(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<T(o,t)))break e;e[r]=t,e[n]=o,n=r}}function C(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],s=i+1,c=e[s];if(void 0!==a&&0>T(a,n))void 0!==c&&0>T(c,a)?(e[r]=c,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==c&&0>T(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var D=[],P=[],A=1,k=null,I=3,O=!1,x=!1,R=!1;function M(e){for(var t=C(P);null!==t;){if(null===t.callback)S(P);else{if(!(t.startTime<=e))break;S(P),t.sortIndex=t.expirationTime,b(D,t)}t=C(P)}}function L(e){if(R=!1,M(e),!x)if(null!==C(D))x=!0,n(N);else{var t=C(P);null!==t&&r(L,t.startTime-e)}}function N(e,n){x=!1,R&&(R=!1,o()),O=!0;var i=I;try{for(M(n),k=C(D);null!==k&&(!(k.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=k.callback;if("function"==typeof a){k.callback=null,I=k.priorityLevel;var s=a(k.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?k.callback=s:k===C(D)&&S(D),M(n)}else S(D);k=C(D)}if(null!==k)var c=!0;else{var l=C(P);null!==l&&r(L,l.startTime-n),c=!1}return c}finally{k=null,I=i,O=!1}}var B=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){x||O||(x=!0,n(N))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return C(D)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,i,a){var s=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return e={id:A++,callback:i,priorityLevel:e,startTime:a,expirationTime:c=a+c,sortIndex:-1},a>s?(e.sortIndex=a,b(P,e),null===C(D)&&e===C(P)&&(R?o():R=!0,r(L,a-s))):(e.sortIndex=c,b(D,e),x||O||(x=!0,n(N))),e},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}}},63840:(e,t,n)=>{"use strict";e.exports=n(60053)},57539:e=>{"use strict";var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},t.getDescription=function(e){var n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){var n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((function(e){return 0===e.indexOf(n)}))},t.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},t.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<r.length;o++)n[(t=r[o].trim().split("="))[0].trim()]=t[1];return n},t.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){var r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],o=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substr(12),password:o.substr(10)}:null},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" "),o=3;o<r.length;o++){var i=r[o],a=t.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(a){var s=t.parseRtpMap(a),c=t.matchPrefix(e,"a=fmtp:"+i+" ");switch(s.parameters=c.length?t.parseFmtp(c[0]):{},s.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(t.parseRtcpFb),n.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(s.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){n.headerExtensions.push(t.parseExtmap(e))})),n},t.writeRtpDescription=function(e,n){var r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=n.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((function(e){r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)}));var o=0;return n.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),r+="a=rtcp-mux\r\n",n.headerExtensions&&n.headerExtensions.forEach((function(e){r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){var n,r=[],o=t.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,l=t.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));l.length>0&&l[0].length>1&&l[0][0]===c&&(n=l[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&n&&(t.rtx={ssrc:n}),r.push(t),i&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&c&&r.push({ssrc:c});var u=t.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,r.forEach((function(e){e.maxBitrate=u}))),r},t.parseRtcpParameters=function(e){var n={},r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);var o=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=o.length>0,n.compound=0===o.length;var i=t.matchPrefix(e,"a=rtcp-mux");return n.mux=i.length>0,n},t.parseMsid=function(e){var n,r=t.matchPrefix(e,"a=msid:");if(1===r.length)return{stream:(n=r[0].substr(7).split(" "))[0],track:n[1]};var o=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(n=o[0].value.split(" "))[0],track:n[1]}:void 0},t.parseSctpDescription=function(e){var n,r=t.parseMLine(e),o=t.matchPrefix(e,"a=max-message-size:");o.length>0&&(n=parseInt(o[0].substr(19),10)),isNaN(n)&&(n=65536);var i=t.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:r.fmt,maxMessageSize:n};if(t.matchPrefix(e,"a=sctpmap:").length>0){var a=t.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:n}}},t.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,n,r){var o=void 0!==n?n:2;return"v=0\r\no="+(r||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,n,r,o){var i=t.writeRtpDescription(e.kind,n);if(i+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),i},t.getDirection=function(e,n){for(var r=t.splitLines(e),o=0;o<r.length;o++)switch(r[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[o].substr(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var n=t.splitLines(e)[0].substr(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){var n=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var n=t.splitLines(e),r=0;r<n.length;r++)if(n[r].length<2||"="!==n[r].charAt(1))return!1;return!0},e.exports=t},90255:(e,t,n)=>{"use strict";var r=n(20773),o=n(25278),i=function(){function e(e){this.bytes=e}return e.prototype.write=function(e,t){return e.set(this.bytes,t),t+this.bytes.length},e.prototype.countSize=function(){return this.bytes.length},e}();t.Value=i;var a=function(){function e(e,n,r){this.id=e,this.children=n;var i=this.children.reduce((function(e,t){return e+t.countSize()}),0);this.sizeMetaData=r?t.UNKNOWN_SIZE:t.vintEncode(o.numberToByteArray(i,t.getEBMLByteLength(i))),this.size=this.id.length+this.sizeMetaData.length+i}return e.prototype.write=function(e,t){return e.set(this.id,t),e.set(this.sizeMetaData,t+this.id.length),this.children.reduce((function(t,n){return n.write(e,t)}),t+this.id.length+this.sizeMetaData.length)},e.prototype.countSize=function(){return this.size},e}();t.Element=a,t.bytes=r((function(e){return new i(e)})),t.number=r((function(e){return t.bytes(o.numberToByteArray(e))})),t.vintEncodedNumber=r((function(e){return t.bytes(t.vintEncode(o.numberToByteArray(e,t.getEBMLByteLength(e))))})),t.string=r((function(e){return t.bytes(o.stringToByteArray(e))})),t.element=function(e,t){return new a(e,Array.isArray(t)?t:[t],!1)},t.unknownSizeElement=function(e,t){return new a(e,Array.isArray(t)?t:[t],!0)},t.build=function(e){var t=new Uint8Array(e.countSize());return e.write(t,0),t},t.getEBMLByteLength=function(e){if(e<127)return 1;if(e<16383)return 2;if(e<2097151)return 3;if(e<268435455)return 4;if(e<34359738367)return 5;if(e<4398046511103)return 6;if(e<562949953421311)return 7;if(e<9007199254740992)return 8;throw e<72057594037927940?new Error("EBMLgetEBMLByteLength: number exceeds Number.MAX_SAFE_INTEGER"):new Error("EBMLgetEBMLByteLength: data size must be less than or equal to "+(Math.pow(2,56)-2))},t.UNKNOWN_SIZE=new Uint8Array([1,255,255,255,255,255,255,255]),t.vintEncode=function(e){return e[0]=t.getSizeMask(e.length)|e[0],e},t.getSizeMask=function(e){return 128>>e-1}},94943:(e,t)=>{"use strict";t.ID={EBML:Uint8Array.of(26,69,223,163),EBMLVersion:Uint8Array.of(66,134),EBMLReadVersion:Uint8Array.of(66,247),EBMLMaxIDLength:Uint8Array.of(66,242),EBMLMaxSizeLength:Uint8Array.of(66,243),DocType:Uint8Array.of(66,130),DocTypeVersion:Uint8Array.of(66,135),DocTypeReadVersion:Uint8Array.of(66,133),Void:Uint8Array.of(236),CRC32:Uint8Array.of(191),Segment:Uint8Array.of(24,83,128,103),SeekHead:Uint8Array.of(17,77,155,116),Seek:Uint8Array.of(77,187),SeekID:Uint8Array.of(83,171),SeekPosition:Uint8Array.of(83,172),Info:Uint8Array.of(21,73,169,102),SegmentUID:Uint8Array.of(115,164),SegmentFilename:Uint8Array.of(115,132),PrevUID:Uint8Array.of(60,185,35),PrevFilename:Uint8Array.of(60,131,171),NextUID:Uint8Array.of(62,185,35),NextFilename:Uint8Array.of(62,131,187),SegmentFamily:Uint8Array.of(68,68),ChapterTranslate:Uint8Array.of(105,36),ChapterTranslateEditionUID:Uint8Array.of(105,252),ChapterTranslateCodec:Uint8Array.of(105,191),ChapterTranslateID:Uint8Array.of(105,165),TimecodeScale:Uint8Array.of(42,215,177),Duration:Uint8Array.of(68,137),DateUTC:Uint8Array.of(68,97),Title:Uint8Array.of(123,169),MuxingApp:Uint8Array.of(77,128),WritingApp:Uint8Array.of(87,65),Cluster:Uint8Array.of(31,67,182,117),Timecode:Uint8Array.of(231),SilentTracks:Uint8Array.of(88,84),SilentTrackNumber:Uint8Array.of(88,215),Position:Uint8Array.of(167),PrevSize:Uint8Array.of(171),SimpleBlock:Uint8Array.of(163),BlockGroup:Uint8Array.of(160),Block:Uint8Array.of(161),BlockAdditions:Uint8Array.of(117,161),BlockMore:Uint8Array.of(166),BlockAddID:Uint8Array.of(238),BlockAdditional:Uint8Array.of(165),BlockDuration:Uint8Array.of(155),ReferencePriority:Uint8Array.of(250),ReferenceBlock:Uint8Array.of(251),CodecState:Uint8Array.of(164),DiscardPadding:Uint8Array.of(117,162),Slices:Uint8Array.of(142),TimeSlice:Uint8Array.of(232),LaceNumber:Uint8Array.of(204),Tracks:Uint8Array.of(22,84,174,107),TrackEntry:Uint8Array.of(174),TrackNumber:Uint8Array.of(215),TrackUID:Uint8Array.of(115,197),TrackType:Uint8Array.of(131),FlagEnabled:Uint8Array.of(185),FlagDefault:Uint8Array.of(136),FlagForced:Uint8Array.of(85,170),FlagLacing:Uint8Array.of(156),MinCache:Uint8Array.of(109,231),MaxCache:Uint8Array.of(109,248),DefaultDuration:Uint8Array.of(35,227,131),DefaultDecodedFieldDuration:Uint8Array.of(35,78,122),MaxBlockAdditionID:Uint8Array.of(85,238),Name:Uint8Array.of(83,110),Language:Uint8Array.of(34,181,156),CodecID:Uint8Array.of(134),CodecPrivate:Uint8Array.of(99,162),CodecName:Uint8Array.of(37,134,136),AttachmentLink:Uint8Array.of(116,70),CodecDecodeAll:Uint8Array.of(170),TrackOverlay:Uint8Array.of(111,171),CodecDelay:Uint8Array.of(86,170),SeekPreRoll:Uint8Array.of(86,187),TrackTranslate:Uint8Array.of(102,36),TrackTranslateEditionUID:Uint8Array.of(102,252),TrackTranslateCodec:Uint8Array.of(102,191),TrackTranslateTrackID:Uint8Array.of(102,165),Video:Uint8Array.of(224),FlagInterlaced:Uint8Array.of(154),FieldOrder:Uint8Array.of(157),StereoMode:Uint8Array.of(83,184),AlphaMode:Uint8Array.of(83,192),PixelWidth:Uint8Array.of(176),PixelHeight:Uint8Array.of(186),PixelCropBottom:Uint8Array.of(84,170),PixelCropTop:Uint8Array.of(84,187),PixelCropLeft:Uint8Array.of(84,204),PixelCropRight:Uint8Array.of(84,221),DisplayWidth:Uint8Array.of(84,176),DisplayHeight:Uint8Array.of(84,186),DisplayUnit:Uint8Array.of(84,178),AspectRatioType:Uint8Array.of(84,179),ColourSpace:Uint8Array.of(46,181,36),Colour:Uint8Array.of(85,176),MatrixCoefficients:Uint8Array.of(85,177),BitsPerChannel:Uint8Array.of(85,178),ChromaSubsamplingHorz:Uint8Array.of(85,179),ChromaSubsamplingVert:Uint8Array.of(85,180),CbSubsamplingHorz:Uint8Array.of(85,181),CbSubsamplingVert:Uint8Array.of(85,182),ChromaSitingHorz:Uint8Array.of(85,183),ChromaSitingVert:Uint8Array.of(85,184),Range:Uint8Array.of(85,185),TransferCharacteristics:Uint8Array.of(85,186),Primaries:Uint8Array.of(85,187),MaxCLL:Uint8Array.of(85,188),MaxFALL:Uint8Array.of(85,189),MasteringMetadata:Uint8Array.of(85,208),PrimaryRChromaticityX:Uint8Array.of(85,209),PrimaryRChromaticityY:Uint8Array.of(85,210),PrimaryGChromaticityX:Uint8Array.of(85,211),PrimaryGChromaticityY:Uint8Array.of(85,212),PrimaryBChromaticityX:Uint8Array.of(85,213),PrimaryBChromaticityY:Uint8Array.of(85,214),WhitePointChromaticityX:Uint8Array.of(85,215),WhitePointChromaticityY:Uint8Array.of(85,216),LuminanceMax:Uint8Array.of(85,217),LuminanceMin:Uint8Array.of(85,218),Audio:Uint8Array.of(225),SamplingFrequency:Uint8Array.of(181),OutputSamplingFrequency:Uint8Array.of(120,181),Channels:Uint8Array.of(159),BitDepth:Uint8Array.of(98,100),TrackOperation:Uint8Array.of(226),TrackCombinePlanes:Uint8Array.of(227),TrackPlane:Uint8Array.of(228),TrackPlaneUID:Uint8Array.of(229),TrackPlaneType:Uint8Array.of(230),TrackJoinBlocks:Uint8Array.of(233),TrackJoinUID:Uint8Array.of(237),ContentEncodings:Uint8Array.of(109,128),ContentEncoding:Uint8Array.of(98,64),ContentEncodingOrder:Uint8Array.of(80,49),ContentEncodingScope:Uint8Array.of(80,50),ContentEncodingType:Uint8Array.of(80,51),ContentCompression:Uint8Array.of(80,52),ContentCompAlgo:Uint8Array.of(66,84),ContentCompSettings:Uint8Array.of(66,85),ContentEncryption:Uint8Array.of(80,53),ContentEncAlgo:Uint8Array.of(71,225),ContentEncKeyID:Uint8Array.of(71,226),ContentSignature:Uint8Array.of(71,227),ContentSigKeyID:Uint8Array.of(71,228),ContentSigAlgo:Uint8Array.of(71,229),ContentSigHashAlgo:Uint8Array.of(71,230),Cues:Uint8Array.of(28,83,187,107),CuePoint:Uint8Array.of(187),CueTime:Uint8Array.of(179),CueTrackPositions:Uint8Array.of(183),CueTrack:Uint8Array.of(247),CueClusterPosition:Uint8Array.of(241),CueRelativePosition:Uint8Array.of(240),CueDuration:Uint8Array.of(178),CueBlockNumber:Uint8Array.of(83,120),CueCodecState:Uint8Array.of(234),CueReference:Uint8Array.of(219),CueRefTime:Uint8Array.of(150),Attachments:Uint8Array.of(25,65,164,105),AttachedFile:Uint8Array.of(97,167),FileDescription:Uint8Array.of(70,126),FileName:Uint8Array.of(70,110),FileMimeType:Uint8Array.of(70,96),FileData:Uint8Array.of(70,92),FileUID:Uint8Array.of(70,174),Chapters:Uint8Array.of(16,67,167,112),EditionEntry:Uint8Array.of(69,185),EditionUID:Uint8Array.of(69,188),EditionFlagHidden:Uint8Array.of(69,189),EditionFlagDefault:Uint8Array.of(69,219),EditionFlagOrdered:Uint8Array.of(69,221),ChapterAtom:Uint8Array.of(182),ChapterUID:Uint8Array.of(115,196),ChapterStringUID:Uint8Array.of(86,84),ChapterTimeStart:Uint8Array.of(145),ChapterTimeEnd:Uint8Array.of(146),ChapterFlagHidden:Uint8Array.of(152),ChapterFlagEnabled:Uint8Array.of(69,152),ChapterSegmentUID:Uint8Array.of(110,103),ChapterSegmentEditionUID:Uint8Array.of(110,188),ChapterPhysicalEquiv:Uint8Array.of(99,195),ChapterTrack:Uint8Array.of(143),ChapterTrackNumber:Uint8Array.of(137),ChapterDisplay:Uint8Array.of(128),ChapString:Uint8Array.of(133),ChapLanguage:Uint8Array.of(67,124),ChapCountry:Uint8Array.of(67,126),ChapProcess:Uint8Array.of(105,68),ChapProcessCodecID:Uint8Array.of(105,85),ChapProcessPrivate:Uint8Array.of(69,13),ChapProcessCommand:Uint8Array.of(105,17),ChapProcessTime:Uint8Array.of(105,34),ChapProcessData:Uint8Array.of(105,51),Tags:Uint8Array.of(18,84,195,103),Tag:Uint8Array.of(115,115),Targets:Uint8Array.of(99,192),TargetTypeValue:Uint8Array.of(104,202),TargetType:Uint8Array.of(99,202),TagTrackUID:Uint8Array.of(99,197),TagEditionUID:Uint8Array.of(99,201),TagChapterUID:Uint8Array.of(99,196),TagAttachmentUID:Uint8Array.of(99,198),SimpleTag:Uint8Array.of(103,200),TagName:Uint8Array.of(69,163),TagLanguage:Uint8Array.of(68,122),TagDefault:Uint8Array.of(68,132),TagString:Uint8Array.of(68,135),TagBinary:Uint8Array.of(68,133)}},36090:(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}r(n(90255)),r(n(94943)),r(n(25278))},25278:(e,t,n)=>{"use strict";var r=n(20773);function o(e){if(e<0)throw new Error("EBML.typedArrayUtils.getNumberByteLength: negative number not implemented");if(e<256)return 1;if(e<65536)return 2;if(e<16777216)return 3;if(e<4294967296)return 4;if(e<1099511627776)return 5;if(e<281474976710656)return 6;if(e<9007199254740992)return 7;throw new Error("EBML.typedArrayUtils.getNumberByteLength: number exceeds Number.MAX_SAFE_INTEGER")}t.numberToByteArray=function(e,t){var n;if(void 0===t&&(t=o(e)),1===t)(n=new DataView(new ArrayBuffer(1))).setUint8(0,e);else if(2===t)(n=new DataView(new ArrayBuffer(2))).setUint16(0,e);else if(3===t)(n=new DataView(new ArrayBuffer(3))).setUint8(0,e>>16),n.setUint16(1,65535&e);else if(4===t)(n=new DataView(new ArrayBuffer(4))).setUint32(0,e);else if(e<4294967295)(n=new DataView(new ArrayBuffer(5))).setUint32(1,e);else if(5===t)(n=new DataView(new ArrayBuffer(5))).setUint8(0,e/4294967296|0),n.setUint32(1,e%4294967296);else if(6===t)(n=new DataView(new ArrayBuffer(6))).setUint16(0,e/4294967296|0),n.setUint32(2,e%4294967296);else if(7===t)(n=new DataView(new ArrayBuffer(7))).setUint8(0,e/281474976710656|0),n.setUint16(1,e/4294967296&65535),n.setUint32(3,e%4294967296);else{if(8!==t)throw new Error("EBML.typedArrayUtils.numberToByteArray: byte length must be less than or equal to 8");(n=new DataView(new ArrayBuffer(8))).setUint32(0,e/4294967296|0),n.setUint32(4,e%4294967296)}return new Uint8Array(n.buffer)},t.stringToByteArray=r((function(e){return Uint8Array.from(Array.from(e).map((function(e){return e.codePointAt(0)})))})),t.getNumberByteLength=o,t.int16Bit=r((function(e){var t=new ArrayBuffer(2);return new DataView(t).setInt16(0,e),new Uint8Array(t)})),t.float32bit=r((function(e){var t=new ArrayBuffer(4);return new DataView(t).setFloat32(0,e),new Uint8Array(t)})),t.dumpBytes=function(e){return Array.from(new Uint8Array(e)).map((function(e){return"0x"+e.toString(16)})).join(", ")}},62548:function(e,t,n){e.exports=function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self;var t=e((function(e,t){!function(t,n){e.exports=n()}(0,(function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function n(n,r){return r&&!0===r.clone&&e(n)?i(t(n),n,r):n}function r(t,r,o){var a=t.slice();return r.forEach((function(r,s){void 0===a[s]?a[s]=n(r,o):e(r)?a[s]=i(t[s],r,o):-1===t.indexOf(r)&&a.push(n(r,o))})),a}function o(t,r,o){var a={};return e(t)&&Object.keys(t).forEach((function(e){a[e]=n(t[e],o)})),Object.keys(r).forEach((function(s){e(r[s])&&t[s]?a[s]=i(t[s],r[s],o):a[s]=n(r[s],o)})),a}function i(e,t,i){var a=Array.isArray(t),s=(i||{arrayMerge:r}).arrayMerge||r;return a?Array.isArray(e)?s(e,t,i):n(t,i):o(e,t,i)}return i.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return i(e,n,t)}))},i}))}));function r(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).map((function(e){e(n)})),(e["*"]||[]).map((function(e){e(t,n)}))}}}var o=e((function(e,t){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=n,e.exports=t.default})),i=function(e){return Object.keys(e).map((function(t){return t+'="'+e[t].toString().replace(/"/g,"&quot;")+'"'})).join(" ")},a=o.svg,s=o.xlink,c={};c[a.name]=a.uri,c[s.name]=s.uri;var l,u=function(e,n){void 0===e&&(e="");var r=t(c,n||{});return"<svg "+i(r)+">"+e+"</svg>"},d=o.svg,_=o.xlink,p={attrs:(l={style:["position: absolute","width: 0","height: 0"].join("; "),"aria-hidden":"true"},l[d.name]=d.uri,l[_.name]=_.uri,l)},h=function(e){this.config=t(p,e||{}),this.symbols=[]};h.prototype.add=function(e){var t=this.symbols,n=this.find(e.id);return n?(t[t.indexOf(n)]=e,!1):(t.push(e),!0)},h.prototype.remove=function(e){var t=this.symbols,n=this.find(e);return!!n&&(t.splice(t.indexOf(n),1),n.destroy(),!0)},h.prototype.find=function(e){return this.symbols.filter((function(t){return t.id===e}))[0]||null},h.prototype.has=function(e){return null!==this.find(e)},h.prototype.stringify=function(){var e=this.config.attrs,t=this.symbols.map((function(e){return e.stringify()})).join("");return u(t,e)},h.prototype.toString=function(){return this.stringify()},h.prototype.destroy=function(){this.symbols.forEach((function(e){return e.destroy()}))};var f=function(e){var t=e.id,n=e.viewBox,r=e.content;this.id=t,this.viewBox=n,this.content=r};f.prototype.stringify=function(){return this.content},f.prototype.toString=function(){return this.stringify()},f.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach((function(t){return delete e[t]}))};var m=function(e){var t=!!document.importNode,n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(n,!0):n},g=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,n=this.render();return this.node=n,t.appendChild(n),n},t.prototype.render=function(){var e=this.stringify();return m(u(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,n),t}(f),v={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},y=function(e){return Array.prototype.slice.call(e,0)},E={isChrome:function(){return/chrome/i.test(navigator.userAgent)},isFirefox:function(){return/firefox/i.test(navigator.userAgent)},isIE:function(){return/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)},isEdge:function(){return/edge/i.test(navigator.userAgent)}},w=function(e,t){var n=document.createEvent("CustomEvent");n.initCustomEvent(e,!1,!1,t),window.dispatchEvent(n)},b=function(e){var t=[];return y(e.querySelectorAll("style")).forEach((function(e){e.textContent+="",t.push(e)})),t},C=function(e){return(e||window.location.href).split("#")[0]},S=function(e){angular.module("ng").run(["$rootScope",function(t){t.$on("$locationChangeSuccess",(function(t,n,r){w(e,{oldUrl:r,newUrl:n})}))}])},T="linearGradient, radialGradient, pattern, mask, clipPath",D=function(e,t){return void 0===t&&(t=T),y(e.querySelectorAll("symbol")).forEach((function(e){y(e.querySelectorAll(t)).forEach((function(t){e.parentNode.insertBefore(t,e)}))})),e};function P(e,t){return y(e).reduce((function(e,n){if(!n.attributes)return e;var r=y(n.attributes),o=t?r.filter(t):r;return e.concat(o)}),[])}var A=o.xlink.uri,k="xlink:href",I=/[{}|\\\^\[\]`"<>]/g;function O(e){return e.replace(I,(function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()}))}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(e,t,n){return y(e).forEach((function(e){var r=e.getAttribute(k);if(r&&0===r.indexOf(t)){var o=r.replace(t,n);e.setAttributeNS(A,k,o)}})),e}var M=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],L=M.map((function(e){return"["+e+"]"})).join(","),N=function(e,t,n,r){var o=O(n),i=O(r);P(e.querySelectorAll(L),(function(e){var t=e.localName,n=e.value;return-1!==M.indexOf(t)&&-1!==n.indexOf("url("+o)})).forEach((function(e){return e.value=e.value.replace(new RegExp(x(o),"g"),i)})),R(t,o,i)},B={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"};return function(e){function n(n){var o=this;void 0===n&&(n={}),e.call(this,t(v,n));var i=r();this._emitter=i,this.node=null;var a=this.config;if(a.autoConfigure&&this._autoConfigure(n),a.syncUrlsWithBaseTag){var s=document.getElementsByTagName("base")[0].getAttribute("href");i.on(B.MOUNT,(function(){return o.updateUrls("#",s)}))}var c=this._handleLocationChange.bind(this);this._handleLocationChange=c,a.listenLocationChangeEvent&&window.addEventListener(a.locationChangeEvent,c),a.locationChangeAngularEmitter&&S(a.locationChangeEvent),i.on(B.MOUNT,(function(e){a.moveGradientsOutsideSymbol&&D(e)})),i.on(B.SYMBOL_MOUNT,(function(e){a.moveGradientsOutsideSymbol&&D(e.parentNode),(E.isIE()||E.isEdge())&&b(e)}))}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var o={isMounted:{}};return o.isMounted.get=function(){return!!this.node},n.prototype._autoConfigure=function(e){var t=this.config;void 0===e.syncUrlsWithBaseTag&&(t.syncUrlsWithBaseTag=void 0!==document.getElementsByTagName("base")[0]),void 0===e.locationChangeAngularEmitter&&(t.locationChangeAngularEmitter=void 0!==window.angular),void 0===e.moveGradientsOutsideSymbol&&(t.moveGradientsOutsideSymbol=E.isFirefox())},n.prototype._handleLocationChange=function(e){var t=e.detail,n=t.oldUrl,r=t.newUrl;this.updateUrls(n,r)},n.prototype.add=function(t){var n=this,r=e.prototype.add.call(this,t);return this.isMounted&&r&&(t.mount(n.node),this._emitter.emit(B.SYMBOL_MOUNT,t.node)),r},n.prototype.attach=function(e){var t=this,n=this;if(n.isMounted)return n.node;var r="string"==typeof e?document.querySelector(e):e;return n.node=r,this.symbols.forEach((function(e){e.mount(n.node),t._emitter.emit(B.SYMBOL_MOUNT,e.node)})),y(r.querySelectorAll("symbol")).forEach((function(e){var t=g.createFromExistingNode(e);t.node=e,n.add(t)})),this._emitter.emit(B.MOUNT,r),r},n.prototype.destroy=function(){var e=this,t=e.config,n=e.symbols,r=e._emitter;n.forEach((function(e){return e.destroy()})),r.off("*"),window.removeEventListener(t.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},n.prototype.mount=function(e,t){void 0===e&&(e=this.config.mountTo),void 0===t&&(t=!1);var n=this;if(n.isMounted)return n.node;var r="string"==typeof e?document.querySelector(e):e,o=n.render();return this.node=o,t&&r.childNodes[0]?r.insertBefore(o,r.childNodes[0]):r.appendChild(o),this._emitter.emit(B.MOUNT,o),o},n.prototype.render=function(){return m(this.stringify())},n.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},n.prototype.updateUrls=function(e,t){if(!this.isMounted)return!1;var n=document.querySelectorAll(this.config.usagesToUpdate);return N(this.node,n,C(e)+"#",C(t)+"#"),!0},Object.defineProperties(n.prototype,o),n}(h)}()},87854:function(e,t,n){e.exports=function(){"use strict";var e=function(e){var t=e.id,n=e.viewBox,r=e.content;this.id=t,this.viewBox=n,this.content=r};e.prototype.stringify=function(){return this.content},e.prototype.toString=function(){return this.stringify()},e.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach((function(t){return delete e[t]}))};var t=function(e){var t=!!document.importNode,n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(n,!0):n};function r(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self;var o=r((function(e,t){!function(t,n){e.exports=n()}(0,(function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function n(n,r){return r&&!0===r.clone&&e(n)?i(t(n),n,r):n}function r(t,r,o){var a=t.slice();return r.forEach((function(r,s){void 0===a[s]?a[s]=n(r,o):e(r)?a[s]=i(t[s],r,o):-1===t.indexOf(r)&&a.push(n(r,o))})),a}function o(t,r,o){var a={};return e(t)&&Object.keys(t).forEach((function(e){a[e]=n(t[e],o)})),Object.keys(r).forEach((function(s){e(r[s])&&t[s]?a[s]=i(t[s],r[s],o):a[s]=n(r[s],o)})),a}function i(e,t,i){var a=Array.isArray(t),s=(i||{arrayMerge:r}).arrayMerge||r;return a?Array.isArray(e)?s(e,t,i):n(t,i):o(e,t,i)}return i.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return i(e,n,t)}))},i}))})),i=r((function(e,t){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=n,e.exports=t.default})),a=function(e){return Object.keys(e).map((function(t){return t+'="'+e[t].toString().replace(/"/g,"&quot;")+'"'})).join(" ")},s=i.svg,c=i.xlink,l={};l[s.name]=s.uri,l[c.name]=c.uri;var u=function(e,t){void 0===e&&(e="");var n=o(l,t||{});return"<svg "+a(n)+">"+e+"</svg>"},d=function(e){function n(){e.apply(this,arguments)}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var r={isMounted:{}};return r.isMounted.get=function(){return!!this.node},n.createFromExistingNode=function(e){return new n({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},n.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},n.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,n=this.render();return this.node=n,t.appendChild(n),n},n.prototype.render=function(){var e=this.stringify();return t(u(e)).childNodes[0]},n.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(n.prototype,r),n}(e);return d}()},11317:function(e){e.exports=function(){"use strict";class e{constructor(e=0,t=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.size=0,this.ttl=t}has(e){return e in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){const t=this.items[e];delete this.items[e],this.size--,null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),this.last===t&&(this.last=t.prev)}return this}evict(){const e=this.first;return delete this.items[e.key],this.first=e.next,this.first.prev=null,this.size--,this}get(e){let t;if(this.has(e)){const n=this.items[e];this.ttl>0&&n.expiry<=(new Date).getTime()?this.delete(e):(t=n.value,this.set(e,t,!0))}return t}keys(){return Object.keys(this.items)}set(e,t,n=!1){let r;if(n||this.has(e)){if(r=this.items[e],r.value=t,!1===n&&(r.expiry=this.ttl>0?(new Date).getTime()+this.ttl:this.ttl),this.last!==r){const e=this.last,t=r.next,n=r.prev;this.first===r&&(this.first=r.next),r.next=null,r.prev=this.last,e.next=r,null!==n&&(n.next=t),null!==t&&(t.prev=n)}}else this.max>0&&this.size===this.max&&this.evict(),r=this.items[e]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t},1==++this.size?this.first=r:this.last.next=r;return this.last=r,this}}return function(t=1e3,n=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(n)||n<0)throw new TypeError("Invalid ttl value");return new e(t,n)}}()},89798:(e,t,n)=>{"use strict";n.d(t,{setLoginConfig:()=>r,setApiConfig:()=>o,api:()=>i,removeLoginCache:()=>a});var r=function(e){return window.vkApi?window.vkApi.setLoginConfig(e):console.error("[VKJS]: setLoginConfig didn't allowed. Use makeAuthAndApiGlobal function")},o=function(e){return window.vkApi?window.vkApi.setApiConfig(e):console.error("[VKJS]: setApiConfig didn't allowed. Use makeAuthAndApiGlobal function")},i=function(e,t,n,r){return void 0===r&&(r={}),window.vkApi?window.vkApi.api(e,t,n,r):Promise.reject("[VKJS][API]: api didn't allowed. Use makeAuthAndApiGlobal function")},a=function(e,t){return window.vkApi?window.vkApi.removeLoginCache(e,t):console.error("[VKJS]: removeLoginCache didn't allowed. Use makeAuthAndApiGlobal function")}},46934:(e,t,n)=>{"use strict";n.d(t,{TaskQueue:()=>s});var r,o=n(70655),i=n(94795),a=n.n(i);!function(e){e.EV_GC_START="ev_gc_start",e.EV_GC_END="ev_gc_end",e.EV_PAUSED="ev_paused",e.EV_RESTARTED="ev_restarted",e.EV_NEW_HANDLER="ev_new_handler",e.EV_RM_HANDLER="ev_rm_handler",e.EV_TASK_START="ev_task_start"}(r||(r={}));var s=function(){function e(e){var t=this;void 0===e&&(e=function(){}),this._errorHandler=e,this._timerInterval=15,this._handlers=Object.create(null),this._emitter=new(a()),this._q=[],this.destroy=function(){t.pause(),clearInterval(t._gcTimer)},this.pause=function(){t._timer&&(clearTimeout(t._timer),t._timer=void 0,t._emitter.emit(r.EV_PAUSED))},this.restart=function(){t._timer||(t._next(),t._emitter.emit(r.EV_RESTARTED))},this.push=function(e){t._q.push(e),t.restart()},this.setHandler=function(e,n,o){void 0===o&&(o=!1),n.once=o,t._handlers[e]=n,t._emitter.emit(r.EV_NEW_HANDLER,e)},this.removeHandler=function(e){delete t._handlers[e],t._emitter.emit(r.EV_RM_HANDLER,e)},this._next()}return Object.defineProperty(e.prototype,"events",{get:function(){return this._emitter},enumerable:!1,configurable:!0}),e.migrate=function(t,n){void 0===n&&(n=function(){});var r=new e(n);return r.pause(),t&&t.destroy&&t._handlers&&t._q&&(t.destroy(),Object.keys(t._handlers).forEach((function(e){var n=t._handlers[e];r.setHandler(e,n,n.once)})),t._q.forEach((function(e){return r.push(e)}))),r.restart(),r},e.prototype.setupGc=function(t){this._gcTimer&&clearInterval(this._gcTimer),this._gcTimer=setInterval(this._gcTask.bind(this),t||e._gcDefaultInterval)},e.prototype._next=function(e){void 0===e&&(e=!1),this._timer=setTimeout(this._processNext.bind(this),e?0:this._timerInterval)},e.prototype._gcTask=function(){this.pause(),this._emitter.emit(r.EV_GC_START);var e=this._q.filter((function(e){return e.postponed}));this._q=this._q.filter((function(e){return!e.postponed})),this._emitter.emit(r.EV_GC_END,e),this.restart()},e.prototype._processNext=function(){var e=this,t=(0,o.__read)(this._q.splice(0,1),1)[0];if(t){var n,i=this._handlers[t.selector];if((null==i?void 0:i.once)&&this.removeHandler(t.selector),!i)return t.postponed||(t.postponed=!0),this._q.push(t),void(this._timer&&this._next());this._emitter.emit(r.EV_TASK_START,t.selector),window._tqVerbose&&console.info("Running evbus task",t.selector);try{n=Promise.resolve(i(t))}catch(e){n=Promise.reject(e)}n.then((function(){e._next(!0)}),(function(n){e._errorHandler&&e._errorHandler(t,n),e._next(!0)}))}else this.pause()},e._gcDefaultInterval=5e3,e}()},82804:(e,t,n)=>{"use strict";n.d(t,{init:()=>r.init,tq:()=>r.tq,processExecData:()=>o.processExecData});var r=n(70698),o=n(42459)},70698:(e,t,n)=>{"use strict";n.d(t,{isTQInitialized:()=>u,init:()=>d,tq:()=>p,tqi:()=>h,tqs:()=>f});var r=n(46934),o=n(42459),i=n(66433),a=function(e,t){var n={message:"Task execution error",data:{taskName:e.selector,type:void 0===e.payload.dataAttrs?"startup_task":"interactive_task",params:JSON.stringify(void 0===e.payload.dataAttrs?e.payload.data:e.payload.dataAttrs)}};(0,i.logError)(t,{environment:"task_queue",breadcrumb:n}),console.error(t)},s=function(){if(!document.head)throw new Error("Document must be loaded before queue init");return document.head},c=function(e){document.addEventListener("DOMContentLoaded",e),"interactive"!==document.readyState&&"complete"!==document.readyState||e()},l=function(){return c((function(){(0,o.unregisterGlobalTqHandlers)(document.body,s()._tqhl),s()._tqhl=(0,o.registerGlobalTqHandlers)(document.body)}))},u=function(){return!!s()._tq},d=function(){var e=s();u()?(e._tqi=r.TaskQueue.migrate(e._tqi,a),e._tqs=r.TaskQueue.migrate(e._tqs,a),l()):function(){var e=s();e._tqs=new r.TaskQueue(a),e._tqi=new r.TaskQueue(a),l(),e._tq={setInteractiveHandler:function(t,n,r){return void 0===r&&(r=!1),e._tqi.setHandler(t,n,r)},setStartupHandler:function(t,n,r){void 0===r&&(r=!1),e._tqs.setHandler(t,n,r),c((function(){e._tqs.setupGc(),e._tqs.restart()}))}},c((function(){e._tqi.setupGc(),(0,o.initMutationObserver)(),(0,o.processTreeOfNodes)(document)}))}()},_=function(e){return function(){var t=s();if(!t["_"+e])throw new Error(e+" not initialized");return t["_"+e]}},p=_("tq"),h=_("tqi"),f=_("tqs")},42459:(e,t,n)=>{"use strict";n.d(t,{processExecData:()=>c,processTreeOfNodes:()=>d,initMutationObserver:()=>_,registerGlobalTqHandlers:()=>p,unregisterGlobalTqHandlers:()=>h});var r=n(70655),o=n(70698),i={click:1,mouseover:1,mouseout:1,keyup:1,keydown:1,change:1,paste:1},a=["focus","mouseenter","mouseleave"],s=function(e){return function(t){var n;if(t.type===e&&t.target&&e&&(n=t.target.nodeType===Node.TEXT_NODE?t.target.parentNode:t.target,r=n,!Object.keys(r).some((function(e){return e.startsWith("_react")||e.startsWith("__react")}))&&n.dataset)){var r,i=n.dataset["task"+(e.toUpperCase()[0]+e.slice(1))];if(!i){if("click"!==t.type)return;var a=n.closest("[data-task-click]");if(!a)return;n=a,i=a.dataset["task"+(e.toUpperCase()[0]+e.slice(1))]}return i&&((0,o.tqi)().push({selector:i,payload:{target:n,dataAttrs:n.dataset,event:t},postponed:!1,createTime:Date.now()}),n.dataset.prevent)?(2&Number(n.dataset.prevent)&&t.stopPropagation(),t.preventDefault(),!1):void 0}}},c=function(e,t){var n={};try{n=JSON.parse(e)}catch(t){console.error("Failed to parse JSON: ",e)}for(var r in n)n.hasOwnProperty(r)&&(0,o.tqs)().push({selector:r,payload:{target:t,data:n[r]},postponed:!1,createTime:Date.now()})},l=function(e){if(e.matches("[data-exec]")){var t=e.dataset.exec||"{}";e.removeAttribute("data-exec"),c(t,e)}},u=function(e){var t,n,i,s=function(t){var n="data-task-"+t;if(e.hasAttribute(n)){var r=null!==(i=e.getAttribute(n))&&void 0!==i?i:"";e.removeAttribute(n),e.addEventListener(t,(function(t){var n=(0,o.tqi)()._handlers[r];Promise.resolve(null).then((function(){return null==n?void 0:n({selector:r,payload:{dataAttrs:e.dataset,target:e,event:t},postponed:!1,createTime:Date.now()})})).catch((function(e){return console.error(e)}))}))}};try{for(var c=(0,r.__values)(a),l=c.next();!l.done;l=c.next()){s(l.value)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}},d=function(e){var t,n,o,i,s,c;void 0===e&&(e=document);try{for(var d=(0,r.__values)(e.querySelectorAll("[data-exec]")),_=d.next();!_.done;_=d.next()){((v=_.value)instanceof HTMLElement||v instanceof SVGElement)&&l(v)}}catch(e){t={error:e}}finally{try{_&&!_.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}try{for(var p=(0,r.__values)(a),h=p.next();!h.done;h=p.next()){var f=h.value;try{for(var m=(s=void 0,(0,r.__values)(e.querySelectorAll("[data-task-"+f+"]"))),g=m.next();!g.done;g=m.next()){var v;((v=g.value)instanceof HTMLElement||v instanceof SVGElement)&&u(v)}}catch(e){s={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}},_=function(){window._obs=new MutationObserver((function(e){var t,n,o,i;try{for(var a=(0,r.__values)(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{for(var _=(o=void 0,(0,r.__values)(c.addedNodes)),p=_.next();!p.done;p=_.next()){var h=p.value;(h instanceof HTMLElement||h instanceof SVGElement)&&(l(h),u(h),d(h))}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=_.return)&&i.call(_)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}})),window._obs.observe(document,{subtree:!0,childList:!0,attributes:!0})},p=function(e){var t={};for(var n in i)if(i.hasOwnProperty(n)){var r=s(n);e.addEventListener(n,r),t[n]=r}return t},h=function(e,t){for(var n in t)t.hasOwnProperty(n)&&e.removeEventListener(n,t[n])}},87294:(e,t,n)=>{"use strict";n.d(t,{post:()=>o});var r=n(70655);n(68040),n(38736);function o(e,t,n){return t&&(t.im_v=3),new Promise((function(o,i){window.ajax.post(e,t,{timeout:n,onDone:function(){o.apply(null,[(0,r.__spreadArray)([],(0,r.__read)(arguments))])},onFail:function(){return i.apply(null,(0,r.__spreadArray)([],(0,r.__read)(arguments))),!0}})}))}},11417:(e,t,n)=>{"use strict";n.d(t,{ColorSchemeMode:()=>r,ColorScheme:()=>l,colorScheme:()=>c});var r,o,i,a=n(76567),s=n(61540);!function(e){e.Light="light",e.Dark="dark",e.Auto="auto"}(r||(r={})),function(e){e.Dark="space_gray",e.Light="bright_light",e.WebDark="vkcom_dark",e.WebLight="vkcom_light"}(o||(o={})),function(e){e.Dark="#222222",e.Light="#ffffff"}(i||(i={}));var c,l=function(){function e(){this.currentMode="",this.subscribers=[],this.initSubscribers=[],this.isExecuted=!1,this.isModeSavingAllowed=!0,this.isSchemeSavingAllowed=!0}return e.prototype.init=function(t){var n=this;this.isExecuted||(this.schemesMap=t.schemesMap,this.setMode(t.mode),this.initSubscribers.forEach((function(e){e()})),e.isSchemesAutoSwitchingSupported()&&(window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(e){n.currentMode===r.Auto&&n.setScheme(e.matches)})),this.isExecuted=!0))},e.prototype.setScheme=function(t){var n;e.isSchemesSupported()&&(this.applyScheme(document.body,t?o.Dark:o.Light),this.currentIsDark=t,null===(n=document.querySelector("meta[name=theme-color]"))||void 0===n||n.setAttribute("content",t?i.Dark:i.Light),this.isSchemeSavingAllowed&&(0,a.setCookie)("remixdark_color_scheme",Number(t),365),this.subscribers.forEach((function(e){e()})))},e.prototype.isDarkScheme=function(){return this.currentIsDark},e.prototype.getMode=function(){return this.currentMode},e.prototype.setMode=function(t){this.currentMode=t;var n=!1;switch(t){case r.Light:n=!1;break;case r.Dark:n=!0;break;case r.Auto:if(e.isSchemesAutoSwitchingSupported())n=window.matchMedia("(prefers-color-scheme: dark)").matches}this.setScheme(n),this.isModeSavingAllowed&&(0,a.setCookie)("remixcolor_scheme_mode",t,365)},e.prototype.getScheme=function(){return(0,s.isMvk)()?this.getMVKScheme():this.getWebScheme()},e.prototype.getMVKScheme=function(){return this.isDarkScheme()?o.Dark:o.Light},e.prototype.getWebScheme=function(){return this.isDarkScheme()?o.WebDark:o.WebLight},e.prototype.applyScheme=function(e,t){var n,r=(null===(n=this.schemesMap)||void 0===n?void 0:n[t])||t;e.setAttribute("scheme",r)},e.prototype.subscribe=function(e){var t=this;return this.subscribers.push(e),function(){t.subscribers=t.subscribers.filter((function(t){return e!==t}))}},e.prototype.onInit=function(e){var t=this;return this.initSubscribers.push(e),function(){t.initSubscribers=t.initSubscribers.filter((function(t){return e!==t}))}},e.isSchemesSupported=function(){return(!(0,s.isMvk)()||window.isNewMail)&&window.CSS&&CSS.supports&&CSS.supports("color","var(--custom-property)")},e.isSchemesAutoSwitchingSupported=function(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme)").matches},e}();c=window.colorScheme?window.colorScheme:new l,window.colorScheme=c,window.isSchemesSupported=l.isSchemesSupported.bind(null)},38736:(e,t,n)=>{"use strict";n.d(t,{processWaf:()=>s});var r=n(19331),o=n(61540),i=!1;function a(){return(0,r.partConfigEnabled)((0,o.isMvk)()?"mvk_waf_ajax_request_enabled":"waf_ajax_request_enabled")}function s(e){if(!a())return!1;var t=!1;e instanceof XMLHttpRequest?t=function(e){return void 0===e&&(e=""),a()&&""!==e}(e.getResponseHeader("X-WAF-Redirect")||""):e&&(t=function(e){return a()&&429===e.status&&"429.html"===e.source}(e));return!!t&&(i||(i=!0,location.reload()),!0)}},30104:(e,t,n)=>{"use strict";function r(e){if(e)for(;e.firstChild;)e.removeChild(e.firstChild)}n.d(t,{emptyNode:()=>r,setGlobalCustomProperty:()=>o});var o=function(e,t){document.documentElement.style.setProperty(e,t)}},21422:(e,t,n)=>{"use strict";n.d(t,{logError:()=>i,debugBufferLog:()=>a});var r=n(36878),o=n(9509);function i(e,t){if(void 0===t&&(t={}),null===window||void 0===window?void 0:window.Raven){var n=t.breadcrumb,i=t.environment;n&&window.Raven.captureBreadcrumb({message:n.message,category:o.customBreadcrumbCategory,data:n.data}),i?window.Raven.captureException(e,{environment:i}):window.Raven.captureException(e),(0,r.logError)(e,t)}}function a(e){return i(e,{environment:"debugLog"})}},78276:(e,t,n)=>{"use strict";n.d(t,{isStuckError:()=>f,pruneRequestFromStuckErrors:()=>m});var r,o,i=n(70655),a=n(19331),s=n(43672),c=n(45611),l="mvk"===(null===(o=null===(r=window.vk)||void 0===r?void 0:r.statsMeta)||void 0===o?void 0:o.platform)&&(0,a.partConfigEnabled)("mute_mvk_err_peaks"),u=n(11317),d=10,_=l&&u(d),p=l&&u(d,5e3),h=function(e){var t=e.value,n=e.stacktrace,r=e.file,o=e.page;return[t,n.join(""),r,o].join("_")},f=function(e){if(!l||!p||!_)return!1;var t=h(e),n=(0,i.__read)([_.get(t)||0,p.get(t)||0],2),r=n[0],o=n[1];return _.set(t,++r),p.set(t,++o),o>=d||r>=50},m=l?function(e){var t,n,r=Date.now(),o="jsErrorLogs",a=(0,s.getWebStatsStringValue)(o,e);if(((null===(t=a.match(new RegExp("},{","g")))||void 0===t?void 0:t.length)||0)<d)return e;try{n=JSON.parse(a)}catch(e){(0,c.logProcessingTime)(1,"dedupe-fail")}if(!n)return e;var l=Object.values(n.reduce((function(e,t){var n,r=h(t),o=e[r]||[];return(0,i.__assign)((0,i.__assign)({},e),((n={})[r]=o.length<d?o.concat(t):o,n))}),{})),u=e.replace('"jsErrorLogs":'+a,'"jsErrorLogs":'+JSON.stringify([].concat.apply([],l))),_=Date.now()-r;return _>16&&(0,c.logProcessingTime)(_,"dedupe"),u}:function(e){return e}},66433:(e,t,n)=>{"use strict";n.d(t,{logError:()=>r.logError,debugBufferLog:()=>r.debugBufferLog});n(34707);var r=n(21422)},34707:(e,t,n)=>{"use strict";n(71516),n(78276)},49464:(e,t,n)=>{"use strict";n.d(t,{NarrativeAnalyticEventType:()=>r,NarrativeAnalyticNavScreen:()=>o,sendNarrativeAnalytic:()=>s});var r,o,i=n(79957),a=n(19331);function s(e,t,n){var r;void 0===n&&(n=o.other);var s=(null==t?void 0:t.title)||void 0,c=(null==t?void 0:t.customCover)?0:(null==t?void 0:t.coverStoryId)||0,l=(null==t?void 0:t.id)||0,u=(null==t?void 0:t.ownerId)||0,d=null===(r=null==t?void 0:t.stories)||void 0===r?void 0:r.map((function(e){return e.id})),_={event_type:e,nav_screen:n,narrative_owner_id:u,narrative_id:l,narrative_title:s,story_ids:(null==d?void 0:d.length)?d:void 0,cover_story_id:c};(0,i.statlogsValueEvent)("narrative_product_analytic",_),(0,a.partConfigEnabled)("narratives_web_analytic_debug")&&console.log("-- narrative analytic",_)}!function(e){e.clickToAddToNarrative="click_to_add_to_narrative",e.addStoryToNarrative="add_story_to_narrative",e.openNarrativeList="open_narrative_list",e.close="close",e.changeSort="change_sort",e.publishNarrative="publish_narrative",e.createNarrative="create_narrative",e.deleteNarrative="delete_narrative",e.clickToEditNarrative="click_to_edit_narrative",e.editNarrative="edit_narrative",e.addToBookmarks="add_to_bookmarks",e.shareNarrative="share_narrative",e.seeMore="see_more",e.addToNarrativeFromActionSheet="add_to_narrative_from_action_sheet"}(r||(r={})),function(e){e.storyArchive="story_archive",e.storyViewer="story_viewer",e.profile="profile",e.feedBlock="narratives_feed_block",e.club="club",e.other="other"}(o||(o={}))},38046:(e,t,n)=>{"use strict";var r;n.d(t,{BatchOperationType:()=>r}),function(e){e.Add="add",e.Delete="delete"}(r||(r={}))},20820:(e,t,n)=>{"use strict";n.d(t,{parseJSON:()=>i});var r=n(66433),o=n(9509);function i(e){try{return JSON.parse(e)}catch(n){var t={environment:"parseJsonError",breadcrumb:{message:"Uncaught json parse error",data:{json:e},category:o.customBreadcrumbCategory}};return(0,r.logError)(n,t),{}}}},35779:(e,t,n)=>{"use strict";n.d(t,{logQuestionError:()=>o});var r=n(66433);function o(e,t){if(t?console.error(e,t):console.error(e),e instanceof Error){var n=new Error(o(e.message,t));return n.name=e.name,n.stack=e.stack,void(0,r.logError)(e)}function o(e,t){return t?t+": "+e:e}"string"!=typeof e?e instanceof Object?(0,r.logError)(new Error(o(JSON.stringify(e),t))):e||!t||(0,r.logError)(new Error(t)):(0,r.logError)(new Error(o(e,t)))}},37482:(e,t,n)=>{"use strict";n.d(t,{QuestionsStatCollector:()=>c});var r=n(14547),o=n(40517),i=n(19331),a=n(64260),s=n(32010),c=function(){function e(){this.productionStatCollector=new r.ProductionStatCollector,this.clickStatCollector=new r.ClickStatCollector(this.productionStatCollector)}return e.prototype.logClickEvent=function(e,t){var n;void 0===t&&(t={});var r=((n={type:o.ClickProductionStatEventTypes.TYPE_QUESTION_ITEM})[o.ClickProductionStatEventTypes.TYPE_QUESTION_ITEM]={type:e,screen:t.navScreen||window.cur.module||""},n);t.questionReceiverId&&(r[o.ClickProductionStatEventTypes.TYPE_QUESTION_ITEM].question_receiver_id=t.questionReceiverId),t.questionAuthorId&&(r[o.ClickProductionStatEventTypes.TYPE_QUESTION_ITEM].question_author_id=t.questionAuthorId),t.questionText&&(r[o.ClickProductionStatEventTypes.TYPE_QUESTION_ITEM].question_text=t.questionText);var a={type:o.EventItemType.QUESTION,id:t.questionId||0};(0,i.partConfigEnabled)("profile_questions_analytic_debug")&&console.log("--"+e,r,a),this.clickStatCollector.logEvent(r,a)},e.prototype.logOpeningEvent=function(e,t,n){var r;switch(t){case s.QuestionsBoxRef.STORY:r=n===a.QuestionAnalyticBoxName.askQuestion?a.QuestionAnalyticEventType.openAskQuestionFromStory:a.QuestionAnalyticEventType.openMyQuestionsFromStory;break;case s.QuestionsBoxRef.SNIPPET:r=n===a.QuestionAnalyticBoxName.askQuestion?a.QuestionAnalyticEventType.openAskQuestionFromSnippet:a.QuestionAnalyticEventType.openMyQuestionsFromSnippet;break;default:r=n===a.QuestionAnalyticBoxName.askQuestion?a.QuestionAnalyticEventType.openAskQuestionFromUrl:a.QuestionAnalyticEventType.openMyQuestionsFromUrl}var o={questionReceiverId:e};n===a.QuestionAnalyticBoxName.askQuestion&&(o.questionAuthorId=window.vk.id),this.logClickEvent(r,o)},e}()},34234:(e,t,n)=>{"use strict";n.d(t,{logQuestionsOpeningEvent:()=>o});var r=new(n(37482).QuestionsStatCollector);function o(e,t,n){r.logOpeningEvent(e,t,n)}},64260:(e,t,n)=>{"use strict";n.d(t,{QuestionAnalyticEventType:()=>r,QuestionAnalyticBoxName:()=>o});var r,o;n(40517);!function(e){e.clickToQuestion="click_to_question",e.reply="reply",e.replyAgain="reply_again",e.sharing="sharing",e.shareToStory="share_to_story",e.shareToWall="share_to_wall",e.shareToGroup="share_to_group",e.shareToIm="share_to_im",e.openStory="open_story",e.callFriends="call_friends",e.openSettings="open_settings",e.openProfile="open_profile",e.block="block",e.unblock="unblock",e.deleteAllQuestions="delete_all_questions",e.delete="delete",e.cancelDelete="cancel_delete",e.next="next",e.close="close",e.clickToSend="click_to_send",e.sendQuestion="send_question",e.cancelSendQuestion="cancel_send_question",e.cancelWriteAnswer="cancel_write_answer",e.closeMyQuestions="close_my_questions",e.openMyQuestionsFromUrl="open_my_questions_from_url",e.openAskQuestionFromUrl="open_ask_question_from_url",e.openMyQuestionsFromSnippet="open_my_questions_from_snippet",e.openAskQuestionFromSnippet="open_ask_question_from_snippet",e.openMyQuestionsFromStory="open_my_questions_from_story",e.openAskQuestionFromStory="open_ask_question_from_story"}(r||(r={})),function(e){e[e.askQuestion=0]="askQuestion",e[e.myQuestions=1]="myQuestions"}(o||(o={}))},9509:(e,t,n)=>{"use strict";n.d(t,{PROTECTED_MODULE_NAME_TAG:()=>i,topErrorModuleName:()=>a,customBreadcrumbCategory:()=>s});var r,o=n(30360);!function(e){e.ERROR_OF_EXTENSION="ErrorOfExtension",e.KNOWN_ISSUE="KnownIssue"}(r||(r={}));var i="__protectedModuleName",a="genericVkError",s="custom";(0,o.getFunctionName)(void 0),["chrome","moz","safari","safari-web"].map((function(e){return e+"-extension://"}))},36878:(e,t,n)=>{"use strict";n.d(t,{logError:()=>i});var r=n(82991),o=n(9509);function i(e,t){var n=void 0===t?{}:t,i=n.breadcrumb,a=n.environment,s=n.hasDummyStacktrace,c=(0,r.getGlobalObject)();if(null==c?void 0:c.Sentry)return s&&"object"==typeof e&&(null==e?void 0:e.stack)&&delete e.stack,c.Sentry.captureException(e,(function(e){var t,n,r=a||(null===(n=c.cur)||void 0===n?void 0:n.module);return r&&e.setTags(((t={module:r})[o.PROTECTED_MODULE_NAME_TAG]=!0,t)),i&&e.addBreadcrumb({message:i.message,category:o.customBreadcrumbCategory,data:i.data}),e}))}},61540:(e,t,n)=>{"use strict";n.d(t,{VK_SITE_REGEX_SOURCE_UNSAFE:()=>i,VK_HOST_REGEX_UNSAFE:()=>a,VK_ORIGIN_REGEX_STRICT:()=>c,VK_URL_REGEX:()=>l,VK_URL_REGEX_STRICT:()=>u,isMvk:()=>d,getHostName:()=>_,noop:()=>p,loadImage:()=>h,getCroppedImage:()=>f});n(70655);var r=n(40906),o=["vk.com","vk.ru",_()].filter((function(e,t,n){return n.indexOf(e)===t})).concat(["vkontakte.ru","vk.me","userapi.com"]),i=(0,r.escapeRE)(_()),a=new RegExp("("+o.map(r.escapeRE).join("|")+")"),s=(new RegExp(o.map(r.escapeRE).join("|")),new RegExp("^"+a.source+"$"),new RegExp("([a-zA-Z0-9\\.\\_\\-]+\\.)?"+a.source)),c=(new RegExp("^"+s.source+"$"),new RegExp("^(https?:\\/\\/)?"+s.source+"$"),new RegExp("^(https?:\\/\\/)"+s.source+"$")),l=new RegExp("^(https?:\\/\\/)?"+s.source+"($|\\/(.*))"),u=new RegExp("^(https?:\\/\\/)"+s.source+"($|\\/(.*))");function d(){return!!window.isMVK}function _(){var e;return(null===(e=("undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).vk)||void 0===e?void 0:e.__domain)||"vk.com"}var p=function(){};function h(e){return new Promise((function(t,n){var r=new Image;r.crossOrigin=e.startsWith("data:")?null:"Anonymous",r.onerror=function(){return n(new Error("Failed to load image's URL: "+e))},r.onload=function(){return t(r)},r.src=e}))}function f(e,t,n,r,o,i){return void 0===i&&(i=0),new Promise((function(a,s){("string"==typeof e?h(e):Promise.resolve(e)).then((function(e){var c=document.createElement("canvas");c.width=90===i||270===i?e.naturalHeight:e.naturalWidth,c.height=90===i||270===i?e.naturalWidth:e.naturalHeight;var l=c.getContext("2d");if(l){l.fillStyle="#fff",l.fillRect(0,0,l.canvas.width,l.canvas.height),i?(l.translate(c.width/2,c.height/2),l.rotate(i*Math.PI/180),l.drawImage(e,-e.naturalWidth/2,-e.naturalHeight/2)):l.drawImage(e,0,0);var u=l.getImageData(t,n,r,o),d=document.createElement("canvas");d.width=r,d.height=o;var _=d.getContext("2d");if(_)return _.putImageData(u,0,0),h(d.toDataURL("image/jpeg",1)).then(a).catch(s);a(e)}else a(e)})).catch(s)}))}},22683:(e,t,n)=>{"use strict";n.d(t,{vkLocalStorage:()=>u,vkSessionStorage:()=>_});var r,o=function(){function e(){var e=this;this.data={},this.getItem=function(t){return e.data.hasOwnProperty(t)?e.data[t]:null},this.keys=function(){return Object.keys(e.data)}}return e.prototype.setItem=function(e,t){this.data[e]=String(t)},e.prototype.removeItem=function(e){delete this.data[e]},e.prototype.clear=function(){this.data={}},Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.data).length},enumerable:!1,configurable:!0}),e.prototype.key=function(e){return Object.keys(this.data)[e]},e}(),i="vk-ls-dummy",a=Math.random().toString();function s(e){var t=!1;try{var n=window[e];n.setItem(i,a),t=a===n.getItem(i),n.removeItem(i)}catch(e){return!1}return t}function c(){return r||(r=s("localStorage")?window.localStorage:new o)}var l,u={setItem:function(e,t){return c().setItem(e,t)},getItem:function(e){return c().getItem(e)},removeItem:function(e){return c().removeItem(e)},clear:function(){return c().clear()},length:function(){return c().length},key:function(e){return c().key(e)},keys:function(){var e=c();return e instanceof o?e.keys():Object.keys(e)},getPrefixedKeys:function(e){return u.keys().filter((function(t){return t.startsWith(e)}))}};function d(){return l||(l=s("sessionStorage")?window.sessionStorage:new o)}var _={setItem:function(e,t){return d().setItem(e,t)},getItem:function(e){return d().getItem(e)},removeItem:function(e){return d().removeItem(e)},clear:function(){return d().clear()},length:function(){return d().length},key:function(e){return d().key(e)},keys:function(){var e=d();return e instanceof o?e.keys():Object.keys(e)},getPrefixedKeys:function(e){return _.keys().filter((function(t){return t.startsWith(e)}))}}},41319:(e,t,n)=>{"use strict";var r,o,i,a,s;n.d(t,{StoryBlockType:()=>a,StoryListName:()=>s}),function(e){e.PHOTO="photo",e.VIDEO="video",e.LIVE="live"}(r||(r={})),function(e){e.SWIPE="swipe",e.NAVIGATION_BUTTON="navigation_button",e.SIT_POSTING="sit_posting",e.LINK="link",e.STORY_REPLY="story_reply",e.STORY_REPOST="story_repost",e.CATALOG_ADD="catalog_add",e.DIALOG="dialog",e.STORY_LIVE_FINISHED="story_live_finished",e.DIALOG_VKME="dialog_vkme",e.STORY_VIEWER_FINISHED="story_viewer_finished",e.PUSH_TRY_MASK="push_try_mask",e.STORY_VIEWER_TRY_MASK="story_viewer_try_mask",e.LINK_MASK="link_mask",e.POSTING="posting",e.NEW_STORY_AVATAR="new_story_avatar",e.STORY_REPLIES_LIST="story_replies_list",e.STORIES_FEED="stories_feed",e.STORIES_SEARCH_NEWS="stories_search_news",e.QUESTION_STICKER="question_sticker",e.LIST_MIDDLE="list_middle",e.ARCHIVE_EMPTY_BUTTON="archive_empty_button",e.ARCHIVE_MENU_BUTTON="archive_menu_button",e.IM="im",e.PROFILE_BUTTON="profile_button",e.SHARE="share",e.MINI_APP="mini_app",e.SYSTEM_SHARING="system_sharing",e.SHORTCUT="shortcut",e.ARCHIVE_SHARING="archive_sharing",e.STORY_VIEWER_CAMERA_BUTTON="story_viewer_camera_button",e.STORY_VIEWER_MUSIC="story_viewer_music",e.STORY_VIEWER_MUSIC_SHEET="story_viewer_music_sheet",e.REPOST_TO_STORY_ACTIVITY="repost_to_story_activity",e.CHANGE_AVATAR="change_avatar"}(o||(o={})),function(e){e.FEED="feed",e.FEED_MIDDLE="feed_middle",e.LINK="link",e.PROFILE="profile",e.IM_DIALOGS="im_dialogs",e.IM_DIALOG_HEADER="im_dialog_header",e.SNIPPET="snippet",e.REPLY="reply",e.REPLIES_LIST="replies_list",e.REPLY_STORY="reply_story",e.DISCOVER="discover",e.STORIES_MANAGE="stories_manage",e.USER_PERSONAL_CARD="user_personal_card",e.GROUP_PERSONAL_CARD="group_personal_card",e.NARRATIVE_SNIPPET="narrative_snippet",e.NARRATIVE_STORY="narrative_story",e.NARRATIVE_LINK="narrative_link",e.NARRATIVE_RECOMMENDATIONS="narrative_recommendations",e.NARRATIVE_SECTION="narrative_section",e.FAVE="fave",e.SPAMFEED="sf",e.ADS_PREVIEW="ads_preview",e.LIST_MIDDLE="list_middle",e.PLACE_STORY_LIST="place_story_list",e.SEARCH_STORY_LIST="search_story_list",e.STORY_ARCHIVE="story_archive",e.IM_MSG_LIST="im_msg_list",e.NOSPAM="nospam",e.PROFILE_SNACKBAR="profile_snackbar",e.MY_QUESTIONS="questions"}(i||(i={})),function(e){e.stories="stories",e.communityGroupedStories="community_grouped_stories",e.appGroupedStories="app_grouped_stories",e.discover="discover"}(a||(a={})),function(e){e.feed="feed",e.groups="groups",e.apps="apps",e.discover="discover"}(s||(s={}))},4291:(e,t,n)=>{"use strict";n.d(t,{saveStats:()=>v});var r,o=n(70655),i=n(43672),a=n(55695),s=n(45611),c=n(61540),l=n(62110),u=n(78276),d=n(28200),_=1e4,p=0,h=function(){return p*_},f=function(){return!(Date.now()-(0,i.getLastSendTime)()>45e3+h())},m=function(){return r=void 0},g=function(){!0!==r&&(clearTimeout(r),r=window.setTimeout((function(){var e=(0,i.getWebStatDataLs)();m(),e.length>i.emptyStatsDataLs.length&&v(e)}),Math.max(_,(0,i.getLastSendTime)()+45e3-Date.now()+h())))};function v(e,t){var n=e.length>=s.MAX_BODY_SIZE,h=(null==t?void 0:t.force)||n;return!h&&(r||f()||e.length<=i.emptyStatsDataLs.length)?((0,a.logWebStatsEvent)("WebStats delayed.",r),g()):(r=!0,function(e,t){var n=function(t){return setTimeout((function(){return e()}),t)};return(null==t?void 0:t.force)?n(0):window.requestIdleCallback((function(){return n(_)}),{timeout:5e3})}((function(){var e=(0,i.getWebStatDataLs)();if(h||!0===r&&!f()&&e.length>i.emptyStatsDataLs.length)return(0,i.setLastSendTime)(),function(e){var t=window.vk.wsTransport+"/web-stats/"+(window.vk.statsMeta.st?"s":"p"),n=e.length>s.MAX_BODY_SIZE,r=n?(0,d.getMaximumWebStats)(e):e,o=!1;if(!r)return m(),(0,i.clearLsData)();var a=new XMLHttpRequest;a.withCredentials=t.includes("tau."+(0,c.getHostName)()),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){var t=Date.now();a.status<500&&(n&&200===a.status?Object.keys((0,i.getEmptyStatsData)()).forEach((function(e){return(0,l.pullFromWebStats)(e,r)})):(0,i.clearLsData)(),p=0,o=!0),(n||400===a.status)&&(0,s.logProcessingTime)(Date.now()-t,(n?"prune":"clean")+(400===a.status?"-fail":""),(e.length>>>20)+"M "+(r.length>>>20)+"M"),m(),g()}},a.onerror=function(){return!o&&(0,i.clearLsData)()},a.open("POST",t,!0),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.send((0,u.pruneRequestFromStuckErrors)((0,s.appendStatsMeta)(++p,r)))}(e);clearTimeout(Number(r)),m(),g()}),(0,o.__assign)((0,o.__assign)({},t),{force:h})))}},28200:(e,t,n)=>{"use strict";n.d(t,{getMaximumWebStats:()=>a});var r=n(70655),o=n(43672),i=n(45611),a=function(e){var t=Date.now(),n=function(e){return"{"+(null==e?void 0:e.map((function(e){var t=(0,r.__read)(e,2);return'"'+t[0]+'":'+t[1]})).join(","))+"}"},a=(0,r.__read)(Object.keys((0,o.getEmptyStatsData)()).reduce((function(t,n){var i=(0,o.getWebStatsStringValue)(n,e);return"[]"===i?t:(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(t)),[[n,i]])}),[]).sort((function(e,t){var n=(0,r.__read)(e,2)[1];return(0,r.__read)(t,2)[1].length-n.length})).reduce((function(e,t){var o=(0,r.__read)(e,2),a=o[0],s=o[1],c=(0,r.__read)(t,2),l=c[0],u=c[1],d=[[l,u]];return u.length+n(a).length<i.MAX_BODY_SIZE?[a.concat(d),s]:[a,s.concat(d)]}),[[],[]]),2),s=a[0],c=a[1],l=n(s);if((0,i.logProcessingTime)(Date.now()-t,"chunk"),Date.now()-t<500&&c[0]&&l.length<.1*i.MAX_BODY_SIZE){var u=Date.now();try{var d=function(e,t){var n=(0,r.__read)(t,2),o=n[0],a=n[1],s='{"'+o+'":['+JSON.parse(a).reduce((function(t,n,r){return t.length<i.MAX_BODY_SIZE-e.length?t+(0===r?"":",")+JSON.stringify(n):t}),"")+"]}";return"{}"===e?s:(0,i.concatJSONS)(e,s)||e}(l,c.reverse()[0]);return(0,i.logProcessingTime)(Date.now()-u,"batch"),d}catch(e){return(0,i.logProcessingTime)(Date.now()-u,"batch-fail"),""}}return l}},71516:(e,t,n)=>{"use strict";n.d(t,{saveJsErrorLogs:()=>r.saveJsErrorLogs,saveStatlogEvents:()=>r.saveStatlogEvents,saveNetworkStats:()=>r.saveNetworkStats,saveProductionStats:()=>r.saveProductionStats});var r=n(62110)},45611:(e,t,n)=>{"use strict";n.d(t,{MAX_BODY_SIZE:()=>s,concatJSONS:()=>l,appendStatsMeta:()=>u,makeWebStatsRequest:()=>d,logProcessingTime:()=>_});var r=n(70655),o=n(79957),i=n(78276),a=n(61540),s=1.8*Math.pow(10,6),c=function(e){return e.startsWith("{")&&e.endsWith("}")},l=function(e,t){return[e,t].every(c)?e.slice(0,-1)+","+t.substring(1):"{}"},u=function(e,t){var n=window.vk,o=n.id,i=n.statsMeta,a=i.st,s=i.platform,u=(0,r.__rest)(i,["st","platform"]);return l(JSON.stringify({id:o,st:a,platform:s,attempt:e,signTime:u.time,sign:u.hash}),c(t)?t:"{}")},d=function(e,t){return e=e||window.vk.wsTransport+"/web-stats/"+(window.vk.statsMeta.st?"s":"p"),new Promise((function(n,r){var o=new XMLHttpRequest;o.open("POST",e),e.includes("tau."+(0,a.getHostName)())&&(o.withCredentials=!0),o.onload=function(){return this.status>=200&&this.status<300?n(o.response):r({status:this.status,statusText:o.statusText})},o.onerror=function(){return r({status:this.status,statusText:o.statusText})},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send((0,i.pruneRequestFromStuckErrors)("string"==typeof t?t:JSON.stringify(t)))}))};function _(e,t,n){(0,o.statlogsValueEvent)("web_stats_batching_time",e,window.vk.statsMeta.platform,t,n)}},62110:(e,t,n)=>{"use strict";n.d(t,{pullFromWebStats:()=>u,saveJsErrorLogs:()=>_,saveStatlogEvents:()=>p,saveProductionStats:()=>h,saveNetworkStats:()=>f});var r=n(70655),o=n(43672),i=n(50455),a=n(55695),s=n(19331),c=n(4291),l=n(22683),u=function(e,t){var n=(0,o.getWebStatsStringValue)(e,t);if("[]"!==n){var r=(0,o.getWebStatDataLs)().replace(n.slice(1,-1),"").replace(/\[\,/,"[");(0,o.writeLocked)((function(){return l.vkLocalStorage.setItem(o.lsDataKey,r)}))}},d=function(e,t,n,r){if((0,s.partConfigEnabled)("batchify_web_stats")){var u=function(e,t){var n=(0,o.getWebStatsStringValue)(e);return(0,o.getWebStatDataLs)().replace('"'+e+'":'+n,'"'+e+'":'+n.replace(/]$/,("[]"===n?"":",")+JSON.stringify(t)+"]"))}(t,n);(0,o.writeLocked)((function(){return l.vkLocalStorage.setItem(o.lsDataKey,u)})),(0,c.saveStats)(u,r)}else(0,o.writeLocked)((function(){var e=(0,o.fetchDataFromLs)().webStatsData;e[t].push(n),(0,i.saveStats)(e)}));(0,a.logWebStatsEvent)(e,n)},_=function(e){return d("saveJsErrorLogs","jsErrorLogs",e)},p=function(e){var t=e.name,n=e.value,o=e.keys,i=void 0===o?[]:o,a=(0,r.__spreadArray)([Math.round(Number(Date.now())/1e3),t,n],(0,r.__read)(i));return(0,s.partConfigEnabled)("web_stats_transport_debugger")&&console.log("Data was transformed!"),d("saveStatlogEvents","statlogEvents",a)},h=function(e,t){return d("saveProductionStats","productionStats",e,t)},f=function(e){return d("saveNetworkStats","networkStats",e)}},55695:(e,t,n)=>{"use strict";n.d(t,{logWebStatsEvent:()=>o});var r=n(19331);function o(e,t){(0,r.partConfigEnabled)("web_stats_transport_debugger")&&console.log("[new transport debug] "+e,t)}},43672:(e,t,n)=>{"use strict";n.d(t,{lsDataKey:()=>a,getEmptyStatsData:()=>l,emptyStatsDataLs:()=>u,writeLocked:()=>d,getWebStatDataLs:()=>_,serializeDataToLs:()=>p,getWebStatsStringValue:()=>h,fetchDataFromLs:()=>f,clearLsData:()=>m,setLastSendTime:()=>g,getLastSendTime:()=>v,getWebStatsItemsCount:()=>y});var r=n(22683),o=n(55695),i=(0,n(61540).isMvk)()?"mvk":"web",a="XHR_STATS_TRANSPORT_DATA_"+i,s="XHR_STATS_TRANSPORT_META_"+i,c="XHR_STATS_TRANSPORT_DATA_LOCK_"+i,l=function(){return{jsErrorLogs:[],statlogEvents:[],productionStats:[],storyViewStats:[],networkStats:[],customStats:[],webPerfStats:[]}},u=JSON.stringify(l());function d(e){if("locked"!==r.vkSessionStorage.getItem(c)){(0,o.logWebStatsEvent)("writeLocked","lock"),r.vkSessionStorage.setItem(c,"locked");try{e()}catch(e){}return(0,o.logWebStatsEvent)("writeLocked","free"),void r.vkSessionStorage.setItem(c,"free")}setTimeout((function(){return d(e)}),100)}var _=function(){return r.vkLocalStorage.getItem(a)||u},p=function(e){return r.vkLocalStorage.setItem(a,JSON.stringify(e))},h=function(e,t){var n;void 0===t&&(t=_());var r,o=Object.keys(l()).filter((function(t){return t!==e})).join("|"),i=(null===(n=null==t?void 0:t.match(new RegExp('"'+e+'":(\\[.*?\\])(?:,"('+o+')":\\[|}$)')))||void 0===n?void 0:n[1])||"";return(r=i).startsWith("[")&&r.endsWith("]")?i:"[]"};function f(){var e,t=!0;try{var n=_();if(!n)throw new Error("empty data");e=l();var r=JSON.parse(n);Object.keys(e).forEach((function(n){Array.isArray(r[n])&&(t=!1,e[n]=r[n])}))}catch(t){e=l()}return{webStatsData:e,isEmpty:t}}function m(e){e&&(0,o.logWebStatsEvent)("WebStats cleared. "+(e?"Reason: LS is broken.":""),e),d((function(){return r.vkLocalStorage.setItem(a,"")}))}function g(e){void 0===e&&(e=Number(new Date)),r.vkSessionStorage.setItem(s,e.toString())}function v(){return parseInt(""+(r.vkSessionStorage.getItem(s)||0))}function y(e){return Object.values(e).reduce((function(e,t){return e+=t.length}),0)}},50455:(e,t,n)=>{"use strict";n.d(t,{saveStats:()=>p});var r,o=n(70655),i=n(43672),a=n(55695),s=n(19331),c=n(45611),l=6e4,u=12e4,d=1;function _(e){return!!(0,s.partConfigEnabled)("web_stats_send_on_events_limit")&&(1===d&&(0,i.getWebStatsItemsCount)(e)>300)}function p(e){var t=+new Date,n=(0,i.getLastSendTime)();0===n&&(n=t,(0,i.setLastSendTime)(n));var o,c=t-n,d=c/1e3,p=_(e);(0,a.logWebStatsEvent)("saveStats",{nowMs:t,lastTransferTimeMs:n,timePassed:d+"s",statsData:e}),(0,s.partConfigEnabled)("web_stats_debounce")?((0,i.serializeDataToLs)(e),o=function(e,t){return t?0:0===e||e>l?3e3:u}(c,p),window.clearTimeout(r),r=window.setTimeout((function(){return(0,i.writeLocked)((function(){var e=(0,i.fetchDataFromLs)().webStatsData,t=+new Date;f(e),(0,i.clearLsData)(),(0,i.setLastSendTime)(t)}))}),o)):c>l||p?(f(e),(0,i.clearLsData)(),(0,i.setLastSendTime)(t)):((0,i.serializeDataToLs)(e),window.setTimeout(h,u))}function h(){(0,i.writeLocked)((function(){var e=(0,i.fetchDataFromLs)(),t=e.webStatsData;e.isEmpty||p(t)}))}function f(e){(0,a.logWebStatsEvent)("send",e);var t=window.vk,n=t.id,r=t.wsTransport,s=t.statsMeta,l=r+(window.vk&&window.vk.statsMeta&&window.vk.statsMeta.st?"/web-stats/s":"/web-stats/p"),u=(0,o.__assign)((0,o.__assign)({},e),{id:n,st:s.st,platform:s.platform,signTime:s.time,sign:s.hash,attempt:d});(0,c.makeWebStatsRequest)(l,u).then((function(e){(0,a.logWebStatsEvent)("sendStats success",e),d=1})).catch((function(t){return d++,(0,i.writeLocked)((function(){(0,a.logWebStatsEvent)("sendStats try",d),p(e)})),(0,a.logWebStatsEvent)("sendStats error",t),!0})),(0,i.setLastSendTime)(+new Date)}},79746:(e,t,n)=>{"use strict";n.d(t,{ActionStatCollector:()=>i});var r=n(70655),o=n(40517),i=function(){function e(e){this.productionStatCollector=e}return e.prototype.logEvent=function(e,t){var n,i=(0,r.__assign)((0,r.__assign)({},this.productionStatCollector.getBaseEvent()),((n={type:o.ProductionStatEventTypes.TYPE_ACTION})[o.ProductionStatEventTypes.TYPE_ACTION]=e,n));this.productionStatCollector.logEvent(i,t)},e}()},20353:(e,t,n)=>{"use strict";n.d(t,{AdMiniAppsEventStatsCollector:()=>i});var r=n(40517),o=n(14547),i=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.actionStatCollector=new o.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t){var n,o={mini_app_id:e,event:t},i=((n={type:r.ActionProductionStatEventTypes.TYPE_AD_MINI_APPS_EVENT_ITEM})[r.ActionProductionStatEventTypes.TYPE_AD_MINI_APPS_EVENT_ITEM]=o,n);this.actionStatCollector.logEvent(i)},e}()},46991:(e,t,n)=>{"use strict";n.d(t,{BridgeEventStatsCollector:()=>i});var r=n(40517),o=n(14547),i=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.actionStatCollector=new o.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t,n,o){var i,a={webview_url:e,mini_app_id:t,event:n,error:o},s=((i={type:r.ActionProductionStatEventTypes.TYPE_BRIDGE_EVENT_ITEM})[r.ActionProductionStatEventTypes.TYPE_BRIDGE_EVENT_ITEM]=a,i);this.actionStatCollector.logEvent(s)},e}()},10067:(e,t,n)=>{"use strict";n.d(t,{EasterEggsItemStatCollector:()=>i});var r=n(40517),o=n(14547),i=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.actionStatCollector=new o.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t,n,o){var i,a={egg_id:e,egg_event_id:t,position_id:n,event_type:o},s=((i={type:r.ActionProductionStatEventTypes.TYPE_EASTER_EGGS_ITEM})[r.ActionProductionStatEventTypes.TYPE_EASTER_EGGS_ITEM]=a,i);this.actionStatCollector.logEvent(s)},e}()},87486:(e,t,n)=>{"use strict";n.d(t,{GamesJsSDKEventStatsCollector:()=>i});var r=n(40517),o=n(14547),i=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.actionStatCollector=new o.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t){var n,o={app_id:e,event_name:t},i=((n={type:r.ActionProductionStatEventTypes.TYPE_GAMES_JS_SDK_ITEM})[r.ActionProductionStatEventTypes.TYPE_GAMES_JS_SDK_ITEM]=o,n);this.actionStatCollector.logEvent(i)},e}()},24896:(e,t,n)=>{"use strict";n.d(t,{MarketingTransitionItemStatCollector:()=>a});var r=n(40517),o=n(14547),i=n(76567),a=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.actionStatCollector=new o.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t,n,o){var a;void 0===o&&(o="");var s={campaign:e,source:n,event:t,unauth_id:(0,i.getCookie)("remixstid")};o&&(s.url=o);var c=((a={type:r.ActionProductionStatEventTypes.TYPE_MARKETING_TRANSITION_ITEM})[r.ActionProductionStatEventTypes.TYPE_MARKETING_TRANSITION_ITEM]=s,a);this.actionStatCollector.logEvent(c)},e}()},30818:(e,t,n)=>{"use strict";n.d(t,{VkConnectNavigationCollector:()=>a});var r=n(70655),o=n(40517),i=n(14547),a=function(){function e(){this.lastNavEventId=0,this.productionStatCollector=new i.ProductionStatCollector}return e.prototype.logEvent=function(e,t){var n,i,a=this.productionStatCollector.getBaseEvent(),s=(0,r.__assign)((0,r.__assign)({},a),((n={screen:"main",prev_nav_id:this.lastNavEventId,prev_event_id:a.prev_id||0,type:o.ProductionStatEventTypes.TYPE_ACTION})[o.ProductionStatEventTypes.TYPE_ACTION]=((i={type:o.ActionProductionStatEventTypes.TYPE_VK_CONNECT_NAVIGATION_ITEM})[o.ActionProductionStatEventTypes.TYPE_VK_CONNECT_NAVIGATION_ITEM]=e,i),n));this.lastNavEventId=s.id,this.productionStatCollector.logEvent(s,t)},e.prototype.logServiceNavigationOpen=function(e){this.logEvent({event_type:o.IVkConnectNavigationItemEventType.SERVICE_NAVIGATION_OPEN,fields:e})},e.prototype.logServiceNavigationClose=function(e){this.logEvent({event_type:o.IVkConnectNavigationItemEventType.SERVICE_NAVIGATION_CLOSE,fields:e})},e.prototype.logServiceNavigationClick=function(e,t,n){this.logEvent({event_type:o.IVkConnectNavigationItemEventType.SERVICE_NAVIGATION_CLICK,fields:[{name:e,str_value:t,int_value:n}]})},e.prototype.logAccountActionsOpen=function(t){var n={event_type:o.IVkConnectNavigationItemEventType.POPUP_OPEN};e.addFlowTypeIfFeatureExists(n,t),this.logEvent(n)},e.prototype.logAccountActionsClose=function(t){var n={event_type:o.IVkConnectNavigationItemEventType.POPUP_CLOSE};e.addFlowTypeIfFeatureExists(n,t),this.logEvent(n)},e.prototype.logAccountActionsEnterLk=function(t,n){void 0===t&&(t="account_actions");var r={event_type:o.IVkConnectNavigationItemEventType.CLICK_ENTER_LK,flow_service:t};e.addFlowTypeIfFeatureExists(r,n),this.logEvent(r)},e.prototype.logAccountActionsVkPay=function(e){void 0===e&&(e="account_actions"),this.logEvent({event_type:o.IVkConnectNavigationItemEventType.CLICK_VK_PAY,flow_service:e})},e.prototype.logAccountActionsVkCombo=function(e){void 0===e&&(e="account_actions"),this.logEvent({event_type:o.IVkConnectNavigationItemEventType.CLICK_VK_COMBO,flow_service:e})},e.addFlowTypeIfFeatureExists=function(e,t){t&&Object.assign(e,{flow_type:t})},e}()},14443:(e,t,n)=>{"use strict";n.d(t,{ClickStatCollector:()=>i});var r=n(70655),o=n(40517),i=function(){function e(e){this.productionStatCollector=e}return e.prototype.logEvent=function(e,t){var n,i=(0,r.__assign)((0,r.__assign)({},this.productionStatCollector.getBaseEvent()),((n={type:o.ProductionStatEventTypes.TYPE_CLICK})[o.ProductionStatEventTypes.TYPE_CLICK]=(0,r.__assign)({item:t},e),n));this.productionStatCollector.logEvent(i)},e}()},71121:(e,t,n)=>{"use strict";n.d(t,{VkAppsActionMenuStatsCollector:()=>i});var r=n(40517),o=n(14547),i=function(){function e(){this.productStatCollector=new o.ProductionStatCollector,this.clickStatCollector=new o.ClickStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t,n){var o,i={type:n},a=((o={type:r.ClickProductionStatEventTypes.TYPE_MINI_APP_ITEM})[r.ClickProductionStatEventTypes.TYPE_MINI_APP_ITEM]=i,o),s={type:t,id:e};this.clickStatCollector.logEvent(a,s)},e}()},14547:(e,t,n)=>{"use strict";n.d(t,{NavigationStatCollector:()=>d.NavigationStatCollector,ProductionStatCollector:()=>_.ProductionStatCollector,ActionStatCollector:()=>p.ActionStatCollector,ClickStatCollector:()=>h.ClickStatCollector,ViewStatCollector:()=>f.ViewStatCollector,RegistrationItemStatCollector:()=>m.RegistrationItemStatCollector,NavigationProductionStatEventTypes:()=>g.NavigationProductionStatEventTypes,RegistrationFieldItemNames:()=>g.RegistrationFieldItemNames,RegistrationItemEventTypes:()=>g.RegistrationItemEventTypes,EventScreens:()=>g.EventScreens,EventFieldValues:()=>g.EventFieldValues,marketingTransitionItemStat:()=>v,miniAppsItemStats:()=>y,vkConnectNavigationCollector:()=>E});var r=n(24896),o=n(46991),i=n(10067),a=n(71121),s=n(10759),c=n(30818),l=n(20353),u=n(87486),d=n(25623),_=n(78964),p=n(79746),h=n(14443),f=n(34404),m=n(24293),g=n(40517),v=new r.MarketingTransitionItemStatCollector,y=(new i.EasterEggsItemStatCollector,new o.BridgeEventStatsCollector,new l.AdMiniAppsEventStatsCollector,new a.VkAppsActionMenuStatsCollector,new s.MiniAppsEventStatsCollector),E=new c.VkConnectNavigationCollector;new u.GamesJsSDKEventStatsCollector},25623:(e,t,n)=>{"use strict";n.d(t,{NavigationStatCollector:()=>s});var r=n(70655),o=n(40517),i=n(66433),a=n(19331),s=function(){function e(e){this.ProductionStatCollector=e,this.tabId=this.ProductionStatCollector.getIntId()%128}return e.prototype.logEvent=function(e){var t,n=(0,r.__assign)((0,r.__assign)({},this.ProductionStatCollector.getBaseEvent()),((t={type:o.ProductionStatEventTypes.TYPE_NAVGO})[o.ProductionStatEventTypes.TYPE_NAVGO]=e,t));return this.ProductionStatCollector.logEvent(n),{statEvent:n}},e.prototype.getEventTabOpen=function(e){return{subtype:o.NavigationProductionStatEventTypes.TAB_OPEN,tab_id:this.tabId,screen:e}},e.prototype.getEventMove=function(e,t){var n,r,a=this.lastStatEvents,s=this.lastNavEvents;return a&&s?(s.subtype===o.NavigationProductionStatEventTypes.TAB_OPEN?n=s.screen:(n=s.screen_to,r=s.screen),{prev_navgo_id:a.id,subtype:t,screen:n,screen_to:e,screen_prev:r,prev_navgo_timestamp:a.timestamp,tab_id:this.tabId}):((0,i.logError)(new Error("NavigationStatCollector: previous event not found.")),null)},e.prototype.addStatEvent=function(e,t){if(void 0===t&&(t=o.NavigationProductionStatEventTypes.GO),(0,a.partConfigEnabled)("navigation_timespent")){var n;if(t===o.NavigationProductionStatEventTypes.TAB_OPEN)n=this.getEventTabOpen(e);else{var r=this.getEventMove(e,t);if(!r)return;n=r}var i=this.logEvent(n).statEvent;this.lastStatEvents=i,this.lastNavEvents=n}},e.prototype.getModule=function(){var e,t;return null!==(t=null===(e=window.cur)||void 0===e?void 0:e.module)&&void 0!==t?t:"unknown"},e}()},78964:(e,t,n)=>{"use strict";n.d(t,{ProductionStatCollector:()=>a});var r=n(66433),o=n(22463),i=n(71516),a=function(){function e(){this.DEBUG=!1}return e.prototype.getCurrentTime=function(e){void 0===e&&(e=!0);var t=Date.now().toString(10);return e?t+"000":t},e.prototype.getIntId=function(){return Math.floor(Math.random()*e.MAX_INT32)},e.prototype.logEvent=function(e,t){this.DEBUG&&(0,o.log)(e),e.type&&e[e.type]?((0,i.saveProductionStats)(e,t),this.lastEvent=e):(0,r.logError)(new Error("ProductionStatCollector: invalid event."))},e.prototype.getLastEvent=function(){return this.lastEvent},e.prototype.getBaseEvent=function(){var e;return{id:this.getIntId(),prev_id:null===(e=this.lastEvent)||void 0===e?void 0:e.id,timestamp:this.getCurrentTime(),url:window.location.href}},e.MAX_INT32=2147483647,e}()},24293:(e,t,n)=>{"use strict";n.d(t,{RegistrationItemStatCollector:()=>s});var r=n(70655),o=n(40517),i=n(19331),a=n(76567),s=function(){function e(e){this.actionStatCollector=e,this.fields={}}return e.prototype.logFieldInteraction=function(e,t,n){void 0===n&&(n=!1),[o.RegistrationFieldItemNames.PASSWORD,o.RegistrationFieldItemNames.SMS_CODE,o.RegistrationFieldItemNames.RULES_ACCEPT].includes(e)&&(t=t?"1":"0");var r=n?"0":this.actionStatCollector.productionStatCollector.getCurrentTime(!1),i=this.fields[e];i?(i.value=t,i.end_interaction_time=r):this.fields[e]={name:e,value:t,start_interaction_time:r,end_interaction_time:r}},e.prototype.getFieldInteractions=function(){return Object.values(this.fields)},e.prototype.resetFieldInteractions=function(){var e,t;try{for(var n=(0,r.__values)(Object.getOwnPropertyNames(this.fields)),o=n.next();!o.done;o=n.next()){var i=o.value;delete this.fields[i]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.logEvent=function(e,t,n,r){var s;if((0,i.partConfigEnabled)("registration_item_stat")){var c={event_type:e,screen:t,unauth_id:(0,a.getCookie)("remixstid"),sid:(0,a.getCookie)("remixnreg_sid")};[o.RegistrationItemEventTypes.SCREEN_PROCEED,o.RegistrationItemEventTypes.SCREEN_SKIP,o.RegistrationItemEventTypes.SCREEN_RETURN,o.RegistrationItemEventTypes.INCORRECT_SMS_CODE].includes(e)&&(c.screen_to=n,c.fields=this.getFieldInteractions(),this.resetFieldInteractions()),e!==o.RegistrationItemEventTypes.SELECT_COUNTRY_DONE&&e!==o.RegistrationItemEventTypes.PROCEED_OTHER_COUNTRY_CODE||!this.fields[o.RegistrationFieldItemNames.SELECT_COUNTRY_NAME]||(c.fields=this.getFieldInteractions().filter((function(e){return e.name===o.RegistrationFieldItemNames.SELECT_COUNTRY_NAME})),delete this.fields[o.RegistrationFieldItemNames.SELECT_COUNTRY_NAME]);var l=((s={type:o.ActionProductionStatEventTypes.TYPE_REGISTRATION_ITEM})[o.ActionProductionStatEventTypes.TYPE_REGISTRATION_ITEM]=c,s);this.actionStatCollector.logEvent(l,r)}},e}()},40517:(e,t,n)=>{"use strict";var r,o,i,a,s,c,l,u,d,_,p,h,f,m,g,v,y,E,w,b,C,S,T,D;n.d(t,{EventScreens:()=>r,EventFieldValues:()=>o,ProductionStatEventTypes:()=>i,NavigationProductionStatEventTypes:()=>a,ActionProductionStatEventTypes:()=>c,ClickProductionStatEventTypes:()=>l,ViewProductionStatEventTypes:()=>u,EventItemType:()=>h,RegistrationItemEventTypes:()=>m,RegistrationFieldItemNames:()=>g,MarketingTransitionItemCampaignType:()=>v,MarketingTransitionItemEventType:()=>y,IVkConnectNavigationItemEventType:()=>D}),function(e){e.NOWHERE="nowhere",e.OTHER="other",e.START="start",e.START_BOX="start_box",e.START_PROCEED_AS="start_proceed_as",e.REGISTRATION_COMPLETE="registration_complete",e.REGISTRATION_COUNTRY="registration_country",e.REGISTRATION_PHONE="registration_phone",e.REGISTRATION_PHONE_VERIFY="registration_phone_verify",e.REGISTRATION_PASSWORD="registration_password",e.REGISTRATION_EDUCATION="registration_education",e.REGISTRATION_EMAIL="registration_email",e.REGISTRATION_NAME="registration_name",e.REGISTRATION_INVITE_CONFIRM="registration_invite_confirm",e.REGISTRATION_LIST_FRIENDS_FACEBOOK="registration_list_friends_facebook",e.PHONE_2FA_VERIFY="phone_2fa_verify",e.OAUTH_FB="oauth_fb",e.FACEBOOK_REGISTRATION_FAILED="facebook_registration_failed"}(r||(r={})),function(e){e.REGISTERED_VIA_FB="1"}(o||(o={})),function(e){e.TYPE_NAVGO="type_navgo",e.TYPE_ACTION="type_action",e.TYPE_CLICK="type_click",e.TYPE_VIEW="type_view"}(i||(i={})),function(e){e.GO="go",e.BACK="back",e.TAB_OPEN="tab_open"}(a||(a={})),function(e){e.TYPE_DONUT_DESCRIPTION_NAV_ITEM="type_donut_description_nav_item",e.TYPE_MARKET_NAVGO="type_market_navgo",e.TYPE_YOULA_SNIPPET_NAVGO="type_youla_snippet_navgo",e.TYPE_YOULA_RECOMMENDATION_CAROUSEL_NAVGO="type_youla_recommendation_carousel_navgo",e.TYPE_STUDIO_NAVGO="type_studio_navgo"}(a||(a={})),function(e){e.TYPE_YOULA_SNIPPET_ITEM="type_youla_snippet_item",e.TYPE_YOULA_RECOMMENDATIONS_CAROUSEL="type_youla_recommendation_carousel",e.TYPE_YOULA_TRANSITION_TO_ITEM="type_youla_transition_to_item",e.TYPE_YOULA_IM="type_youla_im"}(s||(s={})),function(e){e.TYPE_REGISTRATION_ITEM="type_registration_item",e.TYPE_MARKETING_TRANSITION_ITEM="type_marketing_transition_item",e.TYPE_DONUT_PAYMENT_ITEM="type_donut_payment_item",e.TYPE_CALL_ITEM="type_voip_call_item",e.TYPE_BRIDGE_EVENT_ITEM="type_bridge_event_item",e.TYPE_AD_MINI_APPS_EVENT_ITEM="type_ad_mini_apps_event_item",e.TYPE_EASTER_EGGS_ITEM="type_easter_eggs_item",e.TYPE_VK_CONNECT_NAVIGATION_ITEM="type_vk_connect_navigation_item",e.TYPE_GAMES_JS_SDK_ITEM="type_games_js_sdk_item"}(c||(c={})),function(e){e.TYPE_MARKET_CLICK="type_market_click",e.TYPE_WORKI_CLICK="type_worki_click",e.TYPE_CATALOG_BANNER_ITEM="type_catalog_banner_item",e.TYPE_MINI_APP_ITEM="type_mini_app_item",e.TYPE_MESSAGING_CONTACT_RECOMMENDATIONS_ITEM="type_messaging_contact_recommendations_item",e.TYPE_STUDIO_PERIOD_SELECT="type_studio_period_select",e.TYPE_QUESTION_ITEM="type_question_item"}(l||(l={})),function(e){e.TYPE_CATALOG_BANNER_ITEM="type_catalog_banner_item",e.TYPE_MARKET_VIEW="type_market_view",e.TYPE_MINI_APPS_VIEW_ITEM="type_mini_app_view_item"}(u||(u={})),function(e){e.MARKETPLACE="marketplace",e.MARKETPLACE_BLOCK="marketplace_block",e.MARKETPLACE_SEARCH="marketplace_search"}(d||(d={})),function(e){e.TYPE_MARKET_ORDERS_ITEM="type_market_orders_item",e.TYPE_MARKET_CARTS_ITEM="type_market_carts_item",e.TYPE_MARKET_GOODS_ITEM="type_market_item",e.TYPE_MARKET_MARKETPLACE_ITEM="type_market_marketplace_item"}(_||(_={})),function(e){e.CATALOG_PROMO_BANNER_VIEWED="catalog_promo_banner_viewed"}(p||(p={})),function(e){e.ARTICLE="article",e.GROUP="group",e.PHOTO="photo",e.POST="post",e.STORY="story",e.USER="user",e.BROWSER="browser",e.NARRATIVE="narrative",e.MINI_APP="mini_app",e.GAME="game",e.VIDEO="video",e.MARKET_ITEM="market_item",e.MARKET_ITEM_ALBUM="market_item_album",e.MARKET_ORDER="market_order",e.CATALOG_BANNER="catalog_banner",e.AUDIO_FULLSCREEN_BANNER="audio_fullscreen_banner",e.WORKI_SNIPPET="worki_snippet",e.MINI_APPS_CATALOG_BANNER_VIEWED="catalog_promo_banner_viewed",e.MINI_APPS_CATALOG_BANNER="catalog_promo_banner",e.TYPE_MESSAGING_CONTACT_RECOMMENDATIONS_ITEM="type_messaging_contact_recommendations_item",e.STUDIO="studio",e.OPEN_CATALOG_ECO_MENU="open_catalog_eco_menu",e.QUESTION="question"}(h||(h={})),function(e){e.SWITCH_ITEM_VARIANT_1="switch_item_variant_1",e.SWITCH_ITEM_VARIANT_2="switch_item_variant_2",e.OPEN_WIKI="open_wiki"}(f||(f={})),function(e){e.SCREEN_PROCEED="screen_proceed",e.SCREEN_SKIP="screen_skip",e.SCREEN_RETURN="screen_return",e.COMMON_SERVER_ERROR="common_server_error",e.RESEND_SMS_CODE="resend_sms_code",e.RESEND_SMS_CODE_FAILED="resend_sms_code_failed",e.INCORRECT_SMS_CODE="incorrect_sms_code",e.INCORRECT_PASSWORD="incorrect_password",e.INCORRECT_NAME="incorrect_name",e.INCORRECT_CAPTCHA="incorrect_captcha",e.INCORRECT_PHONE_NUMBER="incorrect_phone_number",e.INCORRECT_BDAY="incorrect_bday",e.INCORRECT_SEX="incorrect_sex",e.INCORRECT_EMAIL="incorrect_email",e.EXISTING_EMAIL="existing_email",e.INCORRECT_EDUCATION="incorrect_education",e.SUCCESS_2FA="success_2fa",e.LOGIN_TAP="login_tap",e.PASSWORD_TAP="passw_tap",e.START_REG_TAP="start_reg_tap",e.FIRST_COUNTRY="first_country",e.FIRST_EDUCATION="first_education",e.FIRST_EMAIL="first_email",e.FIRST_FRIEND_ASK="first_friend_ask",e.SELECT_COUNTRY="select_country",e.SELECT_COUNTRY_DONE="select_country_done",e.INPUT_NUMBER_INTERACTION="input_number_interaction",e.INPUT_CODE_INTERACTION="input_code_interaction",e.PROCEED_OTHER_COUNTRY_CODE="proceed_other_country_code",e.INPUT_PHONE="input_phone",e.INPUT_EMAIL="input_email"}(m||(m={})),function(e){e.PHONE_COUNTRY="phone_country",e.PHONE_NUMBER="phone_number",e.COUNTRY="country",e.CITY="city",e.EMAIL="email",e.UNIVERSITY="university",e.FACULTY="faculty",e.SCHOOL="school",e.CHAIR="chair",e.YEAR_FROM="year_from",e.YEAR_TO="year_to",e.CLASS="class",e.EDU_FORM="edu_form",e.EDU_STATUS="edu_status",e.GRADUATION="graduation",e.SPECIALIZATION="specialization",e.RULES_ACCEPT="rules_accept",e.SMS_CODE="sms_code",e.FIRST_NAME="first_name",e.LAST_NAME="last_name",e.SEX="sex",e.BDAY="bday",e.PASSWORD="password",e.FACEBOOK_REGISTRATION="facebook_registration",e.FRIEND_ASK="friend_ask",e.VERIFICATION_TYPE="verification_type",e.SELECT_COUNTRY_NAME="select_country_name"}(g||(g={})),function(e){e.UNAUTH_BOTTOM_BANNER="unauth_bottom_banner",e.UNAUTH_ACTION_BOX="unauth_action_box"}(v||(v={})),function(e){e.OPEN="open",e.CLOSE="close",e.CLICK_SIGN_UP="click_sign_up",e.CLICK_SIGN_IN="click_sign_in",e.CLICK_OPEN_IN_APP="click_open_in_app"}(y||(y={})),function(e){e.LIKE="like",e.SHARE="share",e.MORE="more"}(E||(E={})),function(e){e.INIT="games_js_sdk_init"}(w||(w={})),function(e){e.ACTION_MENU_SHARE="action_menu_share",e.ACTION_MENU_ADD_TO_FAVOURITES="action_menu_add_to_favourites",e.ACTION_MENU_REMOVE_FROM_FAVOURITES="action_menu_remove_from_favourites",e.ACTION_MENU_ENABLE_NOTIFICATIONS="action_menu_enable_notifications",e.ACTION_MENU_DISABLE_NOTIFICATIONS="action_menu_disable_notifications",e.ACTION_MENU_ALL_APPS="action_menu_all_apps",e.ACTION_MENU_ALL_GAMES="action_menu_all_games",e.ACTION_MENU_COPY="action_menu_copy",e.ACTION_MENU_DELETE="action_menu_delete"}(b||(b={})),function(e){e.CLICK_GAME_CARD="cloud_games_game_click",e.CLICK_DOWNLOAD_GAME="cloud_games_client_download",e.OPEN_SECTION="cloud_games_section_open"}(C||(C={})),function(e){e.SHOW="notifications_request_sent",e.CLOSE="notifications_request_close",e.TIMEOUT_CLOSE="notifications_request_timeout",e.SETTING_OPEN="notifications_request_settings_open"}(S||(S={})),function(e){e.EGG_SHOW="egg_show",e.POPUP_SHOW="popup_show",e.POPUP_ACTION="popup_action"}(T||(T={})),function(e){e.CLICK_ENTER_LK="click_enter_lk",e.CLICK_VK_PAY="click_vk_pay",e.CLICK_VK_COMBO="click_vk_combo",e.POPUP_OPEN="popup_open",e.POPUP_CLOSE="popup_close",e.SERVICE_NAVIGATION_CLICK="service_navigation_click",e.SERVICE_NAVIGATION_OPEN="service_navigation_open",e.SERVICE_NAVIGATION_CLOSE="service_navigation_close"}(D||(D={}))},34404:(e,t,n)=>{"use strict";n.d(t,{ViewStatCollector:()=>i});var r=n(70655),o=n(40517),i=function(){function e(e){this.productionStatCollector=e}return e.prototype.logEvent=function(e,t){var n,i=(0,r.__assign)((0,r.__assign)({},this.productionStatCollector.getBaseEvent()),((n={type:o.ProductionStatEventTypes.TYPE_VIEW})[o.ProductionStatEventTypes.TYPE_VIEW]=(0,r.__assign)({item:t},e),n));this.productionStatCollector.logEvent(i)},e}()},10759:(e,t,n)=>{"use strict";n.d(t,{MiniAppsEventStatsCollector:()=>a});var r=n(70655),o=n(40517),i=n(14547),a=function(){function e(){this.productStatCollector=new i.ProductionStatCollector,this.viewStatCollector=new i.ViewStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e,t,n,i){var a;void 0===n&&(n=""),void 0===i&&(i="");var s=(0,r.__assign)((0,r.__assign)({},e),t),c=((a={type:o.ViewProductionStatEventTypes.TYPE_MINI_APPS_VIEW_ITEM})[o.ViewProductionStatEventTypes.TYPE_MINI_APPS_VIEW_ITEM]=s,a.start_view=n,a.end_view=i,a);this.viewStatCollector.logEvent(c,e)},e}()},98966:(e,t,n)=>{"use strict";n.d(t,{MY_QUESTIONS_BOX_URL_PARAMETER:()=>r,ASK_QUESTION_BOX_URL_PREFIX:()=>o});var r="question",o="ask_question"},51888:(e,t,n)=>{"use strict";n.d(t,{getQuestions:()=>o,getUsers:()=>i});var r=n(89798);function o(e,t){return void 0===e&&(e=""),void 0===t&&(t=15),(0,r.api)("questions.get",{owner_id:window.vk.id,start_from:e,limit:t,extended:1,fields:"photo_50,photo_100,first_name_gen,last_name_gen,domain"})}function i(e){return(0,r.api)("users.get",{user_ids:e.join(","),fields:"photo_50,photo_100,can_ask_anonymous,can_ask_question,first_name_nom,first_name_dat,first_name_gen,last_name_gen,sex"})}},32010:(e,t,n)=>{"use strict";var r;n.d(t,{QuestionsBoxRef:()=>r}),function(e){e.SNIPPET="snippet",e.URL="url",e.STORY="story"}(r||(r={}))},59866:(e,t,n)=>{"use strict";n.d(t,{UnauthorizedSourceType:()=>r});var r={PHOTO:"photo",VIDEO:"video",AUDIO:"audio",COMMENTS:"comments"}},73023:(e,t,n)=>{"use strict";n.d(t,{UploadPhoto:()=>r.UploadPhoto});var r=n(47409)},69351:(e,t,n)=>{"use strict";var r,o,i;n.d(t,{UploadPhotoErrorCodes:()=>r}),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.UPLOAD=1]="UPLOAD",e[e.NOT_ALLOWED_EXTENSION=2]="NOT_ALLOWED_EXTENSION",e[e.IMAGE_TOO_SMALL=3]="IMAGE_TOO_SMALL",e[e.IMAGE_TOO_BIG=4]="IMAGE_TOO_BIG",e[e.BAD_ASPECT_RATIO=5]="BAD_ASPECT_RATIO"}(r||(r={})),function(e){e.UPLOADED="uploaded",e.EXISTED="existed"}(o||(o={})),function(e){e[e.UPLOAD=1]="UPLOAD",e[e.SELECT=2]="SELECT",e[e.EDIT=3]="EDIT"}(i||(i={}))},47409:(e,t,n)=>{"use strict";n.d(t,{UploadPhoto:()=>a});var r=n(70655),o=n(69351),i=n(46512),a=function(){function e(e,t){this.config=(0,r.__assign)({allowedTypes:["*"]},e),this.progressCallback=t}return e.prototype.validate=function(e){var t=this.config,n=t.constraints,a=t.allowedTypes,s=t.lang,c=!1;return a&&(c=a.some((function(t){return"*"===t||t===e.type}))),c?n?(0,i.getImageSizeByBlob)(e).then((function(e){var t=n.maxWidth,i=n.minWidth,a=n.maxHeight,c=n.minHeight,l=n.maxAspectRatio,u=n.minAspectRatio,d=(0,r.__read)(e,2),_=d[0],p=d[1],h=_/p;if(_>t||p>a){var f=(s["error_"+o.UploadPhotoErrorCodes.IMAGE_TOO_BIG]||"").replace("{width}",String(t)).replace("{height}",String(a));return Promise.reject({code:o.UploadPhotoErrorCodes.IMAGE_TOO_BIG,text:f})}if(_<i||p<c){f=(s["error_"+o.UploadPhotoErrorCodes.IMAGE_TOO_SMALL]||"").replace("{width}",String(i)).replace("{height}",String(c));return Promise.reject({code:o.UploadPhotoErrorCodes.IMAGE_TOO_SMALL,text:f})}return u&&u>h||l&&h>l?Promise.reject({code:o.UploadPhotoErrorCodes.BAD_ASPECT_RATIO,text:s["error_"+o.UploadPhotoErrorCodes.BAD_ASPECT_RATIO]}):Promise.resolve(null)})).catch((function(e){return e&&e.text&&e.code?Promise.reject(e):Promise.reject({code:o.UploadPhotoErrorCodes.UNKNOWN,text:s["error_"+o.UploadPhotoErrorCodes.UNKNOWN]})})):Promise.resolve(null):Promise.reject({code:o.UploadPhotoErrorCodes.NOT_ALLOWED_EXTENSION,text:s["error_"+o.UploadPhotoErrorCodes.NOT_ALLOWED_EXTENSION]})},e.prototype.upload=function(e,t,n){var r=this;return void 0===n&&(n="file1"),this.validate(e).then((function(){return new Promise((function(i,a){var s=new XMLHttpRequest,c=new FormData;c.append(n,e),s.open("POST",t||r.config.url,!0),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE&&200===s.status){var e=void 0;try{s.responseText&&(e=JSON.parse(s.responseText))}catch(e){a({code:o.UploadPhotoErrorCodes.UNKNOWN,text:r.config.lang["error_"+o.UploadPhotoErrorCodes.UNKNOWN]})}i(e)}},s.onerror=function(){a({code:o.UploadPhotoErrorCodes.UPLOAD,text:r.config.lang["error_"+o.UploadPhotoErrorCodes.UPLOAD]})},s.upload.onprogress=function(e){r.progressCallback&&r.progressCallback(e.loaded,e.total)},s.send(c)}))}))},e}()},46512:(e,t,n)=>{"use strict";function r(e){return t=URL.createObjectURL(e),new Promise((function(e,n){var r=new Image;r.onload=function(){var t=Number(r.height),n=Number(r.width);e([n,t])},r.onerror=function(){n()},r.onabort=function(){n()},r.src=t}));var t}n.d(t,{getImageSizeByBlob:()=>r})},41929:(e,t,n)=>{"use strict";n.d(t,{BoxModal:()=>s});var r=n(70655),o=n(67294),i=n(83295),a=n(61650),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.appearance,r=e.title,s=e.actionButtons,c=e.onClose,l=e.children,u=e.hint,d=e.hasScroll;return o.createElement("div",{className:"BoxModal"},o.createElement("div",{className:(0,i.classNames)("Modal","Modal--"+n,t)},o.createElement(a.default.Header,{title:r,onClose:c}),Boolean(l)&&o.createElement(a.default.Body,{hasScroll:d},l),Boolean(s)&&o.createElement(a.default.Footer,{actionButtons:s,hint:u})))},t.defaultProps={appearance:"white",hasScroll:!0},t}(o.Component)},49140:(e,t,n)=>{"use strict";n.d(t,{updateArticleSnippetsFromQueueByPost:()=>a});var r=n(66433),o=n(40906),i=n(19331);function a(e){if(window.vk.id&&(0,i.partConfigEnabled)("update_private_snippets_by_queue")){var t=Array.from(e.querySelectorAll(".article_snippet"));if(t.length){var n=[];t.forEach((function(e){if(window.vk.id&&e.dataset.needUpdate){var t=e.dataset.articleRawId;t&&n.push({article_raw_id:t,post_raw_id:e.dataset.postId,is_mini_snippet:(0,o.intval)(e.dataset.isMiniSnippet)})}})),n.length&&window.ajax.post("al_articles.php",{act:"get_snippets",article_snippets:JSON.stringify(n)},{onDone:function(e){t.forEach((function(t){t.dataset.articleRawId&&e[t.dataset.articleRawId]&&(t.outerHTML=e[t.dataset.articleRawId])}))},onFail:function(){return(0,r.logError)(new Error("Fail: updateArticleSnippetsFromQueueByPost")),!0}})}}}},70488:(e,t,n)=>{"use strict";n.d(t,{RegistrationFieldItemNames:()=>r.RegistrationFieldItemNames,RegistrationItemEventTypes:()=>r.RegistrationItemEventTypes,EventScreens:()=>r.EventScreens,EventFieldValues:()=>r.EventFieldValues,registrationItemStat:()=>a});var r=n(14547),o=new r.ProductionStatCollector,i=new r.ActionStatCollector(o),a=new r.RegistrationItemStatCollector(i)},73009:(e,t,n)=>{"use strict";n.d(t,{init:()=>a});var r=n(82804),o=n(70698),i=n(86125),a=function(){var e=(0,o.isTQInitialized)();(0,r.init)(),e||((0,o.tqi)().setHandler("Common/nav_go",(function(e){var t,n;(null===(t=e.payload.event)||void 0===t?void 0:t.target)&&window.nav.go(e.payload.event.target,e.payload.event,JSON.parse((null===(n=e.payload.dataAttrs)||void 0===n?void 0:n.options)||"{}"))}),!1),(0,o.tqi)().setHandler("Common/cur_box_hide",(function(){var e;null===(e=(0,i.curBox)())||void 0===e||e.hide()}),!1))}},83295:(e,t,n)=>{"use strict";function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach((function(e){if(e)switch(typeof e){case"string":n.push(e);break;case"object":Object.keys(e).forEach((function(t){e[t]&&n.push(t)}));break;default:n.push(""+e)}})),n.join(" ")}n.d(t,{classNames:()=>r})},55349:(e,t,n)=>{"use strict";n.d(t,{initVKComboIndexPromo:()=>i});var r=n(82804),o=n(73271);function i(){(0,r.tq)().setInteractiveHandler("IndexComboPromo/register",(function(e){var t=(e.payload.dataAttrs||{}).source;o.Unauthorized.showMoreBox(null,0,t)}))}},67394:(e,t,n)=>{"use strict";n.d(t,{initJoinForm:()=>p});var r=n(70655),o=n(86409),i=n(15544),a=n(86125),s=n(416),c=n(59121),l=n(70769),u=n(70488),d=n(24041),_="join_form_sex";function p(e,t){var n,p=t.from,h=t.bdateMonths,f=t.bdateYears,m=t.proceedAs,g=t.fbApp,v=t.fbState,y=t.fbLocale,E=t.ref,w=t.values,b=void 0===w?{}:w,C=t.onSignInClick,S=t.onNotNowClick,T=window.cur.options||{},D=T.bday||0,P=T.bmonth||0,A=T.byear||0;n="invite"===E?u.EventScreens.REGISTRATION_INVITE_CONFIRM:m?u.EventScreens.START_PROCEED_AS:"box"===E?u.EventScreens.START_BOX:u.EventScreens.START,window.cur.eventScreen=n,u.registrationItemStat.logEvent(u.RegistrationItemEventTypes.SCREEN_PROCEED,u.EventScreens.NOWHERE,n,{force:!0});var k,I,O,x=e.querySelector(".JoinForm__error"),R=e.querySelector('.JoinForm__textInput[name="first_name"]'),M=e.querySelector('.JoinForm__textInput[name="last_name"]'),L=e.querySelector(".JoinForm__birthdateDayInput"),N=e.querySelector(".JoinForm__birthdateMonthInput"),B=e.querySelector(".JoinForm__birthdateYearInput"),U=e.querySelector(".JoinForm__sex"),F=e.querySelectorAll(".JoinForm__sexRadio"),W=e.querySelector(".JoinForm__birthdate"),j=e.querySelector(".JoinForm__submitButton"),V=e.querySelector(".JoinForm__facebookLogin"),H=e.querySelector(".JoinForm__facebookLogin .FacebookLogin__button"),K=e.querySelector(".JoinForm__signIn"),G=e.querySelector(".JoinForm__notNowLink");if(R&&M&&j){var z=function(){if(!d.FlatButton.isLocked(j)){var e={fname:R.value.trim(),lname:M.value.trim(),bday:k.val(),bmonth:I.val(),byear:O.val(),from:p,frm:1,event_screen:n};(0,i.isVisible)(U)&&(e.sex=Number((0,o.radioval)(_))||0),window.tooltips&&window.tooltips.hideAll();var t=function(e,t){e&&t&&window.Index.showRegTT(e,t)};x&&(x.innerHTML=""),window.ajax.post("join.php?act=start",e,{onDone:function(e,n){switch(e){case"first_name":return t(R,n),void(0,o.notaBene)(R);case"last_name":return t(M,n),void(0,o.notaBene)(M);case"sex_row":return(0,i.show)(U),void t(U,n);case"birthdate_row":return void t(W,n)}n&&(0,c.showMsg)(x,n,"error",!0)},showProgress:function(){return d.FlatButton.lock(j)},hideProgress:function(){return d.FlatButton.unlock(j)}})}},q=function(){var e=Number(k.val())||0,t=Number(I.val())||0,n=Number(O.val())||0,r=new Date(0);e&&r.setDate(e),t&&r.setMonth(t),n&&r.setFullYear(n),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.BDAY,r.getTime().toString())},$=function(){var e=window.cur;e.isJoinFieldDirty||(u.registrationItemStat.logEvent(u.RegistrationItemEventTypes.START_REG_TAP,e.eventScreen,void 0,{force:!0}),e.isJoinFieldDirty=!0)};if(u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.FIRST_NAME,R.value,!0),R.addEventListener("keyup",(function(){$(),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.FIRST_NAME,R.value)})),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.LAST_NAME,M.value,!0),M.addEventListener("keyup",(function(){$(),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.LAST_NAME,M.value)})),[R,M].forEach((function(e){(0,s.placeholderInit)(e),e.addEventListener("keydown",(function(e){10!==e.keyCode&&13!==e.keyCode||z()}))})),"index"!==E&&requestAnimationFrame((function(){return(0,i.elfocus)(R)})),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.BDAY,"",!0),k=new window.Dropdown(L,(0,l.generateDays)(A,P),{big_text:!0,multiselect:!1,zeroPlaceholder:!0,selectedItems:D,onChange:function(){$(),q()}}),I=new window.Dropdown(N,h,{big_text:!0,multiselect:!1,zeroPlaceholder:!0,selectedItems:P,onChange:function(e){$(),q(),(0,l.updateDayDropdown)(O.val(),e,k,D)}}),O=new window.Dropdown(B,f,{big_text:!0,multiselect:!1,zeroPlaceholder:!0,selectedItems:A,onChange:function(e){$(),q(),(0,l.updateDayDropdown)(e,I.val(),k,D)}}),window.radioBtns.join_form_sex={els:(0,r.__spreadArray)([],(0,r.__read)(F)),val:0},u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.SEX,Number((0,o.radioval)(_)).toString(),!0),F.forEach((function(e){e.addEventListener("click",(function(){var t=Number(e.dataset.sex);(0,o.radiobtn)(e,t,_),$(),u.registrationItemStat.logFieldInteraction(u.RegistrationFieldItemNames.SEX,t.toString())}))})),void 0!==b.sex){var Y=b.sex,Q=e.querySelector('.JoinForm__sexRadio[data-sex="'+Y+'"]');Q&&Q.click()}if(j.addEventListener("click",(function(e){e.preventDefault(),z()})),g){var X=window.cur;X.fbApp=g,X.fbState=v,X.fbLocale=y,window.Index.fbCheck(g,"",V)}null==H||H.addEventListener("click",(function(e){e.preventDefault(),window.Index.fbJoin("",H)})),K&&C&&K.addEventListener("click",C),G&&S&&G.addEventListener("click",S);var J=(0,a.curBox)();J&&J.setOptions({onClean:function(){k&&k.destroy(),I&&I.destroy(),O&&O.destroy()}}),window.stManager.add([window.jsc("web/tooltips.js"),"tooltips.css"]).catch((function(){}))}}},59367:(e,t,n)=>{"use strict";n.d(t,{initVkIdForm:()=>l});var r=n(88882),o=n(14547),i=n(70488),a=(n(86409),n(24041),n(416),n(41650),7913379),s=o.EventScreens.START;function c(e){e&&(s=o.EventScreens.START_PROCEED_AS),window.cur.eventScreen=s,i.registrationItemStat.logEvent(o.RegistrationItemEventTypes.SCREEN_PROCEED,o.EventScreens.NOWHERE,s,{force:!0})}function l(e,t){var n;!function(){var e=window.vk.apiConfigDomains,t=e.loginDomain,n=e.connectDomain;r.Config.init({appId:a,loginDomain:t,connectDomain:n})}(),t&&c(null!==(n=null==t?void 0:t.proceedAs)&&void 0!==n&&n);var o=e.querySelector(".VkIdForm__signInButton"),i=e.querySelector(".VkIdForm__signUpButton");if(o&&i){o.addEventListener("click",(function(e){var n,o;e.preventDefault(),n=location.protocol+"//"+location.host,o={url:(null==t?void 0:t.toFeed)?n+"/feed":n+"/login"+location.search,action:{name:"no_password_flow",params:{type:"sign_in"}}},r.Connect.redirectAuth(o)})),i.addEventListener("click",(function(e){var t;e.preventDefault(),t={url:location.protocol+"//"+location.host+"/join"+location.search,action:{name:"no_password_flow",params:{type:"sign_up"}}},r.Connect.redirectAuth(t)}))}}},70769:(e,t,n)=>{"use strict";n.d(t,{generateDays:()=>i,updateDayDropdown:()=>a});var r=n(59397),o=n(86067);function i(e,t){for(var n=[[0,(0,o.getLang)("index_sel_bday")]],i=(0,r.getLastDayOfMonth)(e,t),a=1;a<=i;++a)n.push([a,String(a)]);return n}function a(e,t,n,o){Number(n.val())>(0,r.getLastDayOfMonth)(e,t)&&n.clear(),n.setData(i(e,t).slice(Number(o)?1:0))}},3797:(e,t,n)=>{"use strict";function r(){return window.vk.loginDomain}n.d(t,{getLoginDomain:()=>r})},10124:(e,t,n)=>{"use strict";n.d(t,{createModule:()=>c,destroyModule:()=>l});var r=n(70655),o=n(67784),i=n(49535);function a(e,t,n,r){(0,i.addEvent)(t,n,r),e._registeredHandlers.push({handlerType:"bind",elem:t,types:n,handler:r})}function s(e,t,n,r,i,a){(0,o.addDelegateEvent)(t,n,r,i,a),e._registeredHandlers.push({handlerType:"delegate",elem:t,types:n,selector:r,handler:i})}function c(e){var t={_registeredHandlers:[]};return e.handlers((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a.apply(void 0,(0,r.__spreadArray)([t],(0,r.__read)(e)))}),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return s.apply(void 0,(0,r.__spreadArray)([t],(0,r.__read)(e)))})),t}function l(e){e._registeredHandlers.forEach((function(e){var t=e.handlerType,n=e.elem,r=e.types,a=e.handler;"delegate"===t?(0,o.removeDelegateEvent)(n,r,e.selector,a):(0,i.removeEvent)(n,r,a)})),e._registeredHandlers=[]}},41650:(e,t,n)=>{"use strict";n.d(t,{getLang:()=>a,default:()=>s});var r=n(95283),o=n(86067),i={};function a(e,t,n){void 0===t&&(t=!1);var a="number"==typeof t,s=t||a,c=e+(s?".raw":"");if(void 0===i[c]){var l=s?(0,o.getLang)(e,"raw"):(0,o.getLang)(e);"string"==typeof l?i[c]=(0,r.decodeHTMLEntities)(l):Array.isArray(l)?i[c]=l.map(r.decodeHTMLEntities):i[c]="object"==typeof l&&null!==l?Object.keys(l).reduce((function(e,t){return e[t]=(0,r.decodeHTMLEntities)(l[t]),e}),{}):l}if(a){var u=t;return(0,o.langNumeric)(u,i[c],n)}return i[c]||""}const s={getLang:a}},12439:(e,t,n)=>{"use strict";n(9720),n(68958),n(26330),n(95724)},65864:(e,t,n)=>{"use strict";n.d(t,{parseLikeObjectId:()=>o,getElementLikeButtonCount:()=>i,getElementLikeButtonIcon:()=>a});var r=n(70655);function o(e){var t=e.match(/^([a-z_]+)([0-9\-_]+)$/);if(!t)return null;var n=(0,r.__read)(t,3);return{objectType:n[1],objectId:n[2]}}var i=function(e){var t;return null!==(t=null==e?void 0:e.querySelector(".like_button_count, ._like_button_count"))&&void 0!==t?t:void 0},a=function(e){var t;return null!==(t=null==e?void 0:e.querySelector(".like_button_icon, ._like_button_icon"))&&void 0!==t?t:void 0}},25698:(e,t,n)=>{"use strict";n.d(t,{LikeButtonTypes:()=>r});var r={like:"like",share:"share",views:"views",comment:"comment"}},28958:(e,t,n)=>{"use strict";n.d(t,{LoginBoxForm:()=>s});var r=n(416),o=n(86409),i=n(54612),a=n(24041),s=function(){function e(e){this.rootEl=e,this.init()}return e.prototype.init=function(){var e=this.rootEl,t=e.querySelector(".LoginBox__form");if(t){var n=e.querySelector(".LoginBox__formExpire"),s=e.querySelector(".LoginBox__buttonSignIn"),c=e.querySelector(".LoginBox__buttonSignUp"),l=e.querySelector('[name="email"]'),u=e.querySelector('[name="pass"]'),d=e.querySelector('[name="ul"]');s&&(l&&(0,r.placeholderInit)(l),u&&(0,r.placeholderInit)(u),null==n||n.addEventListener("click",(function(e){e.preventDefault(),(0,o.checkbox)(n)})),u&&u.addEventListener("input",(function(){t.classList.toggle("LoginBox--showExpire",u.value.trim().length>0)})),c&&(c.onclick=function(){return(0,i.showBox)("join.php",{act:"box",from:window.nav.strLoc}),!1}),t.onsubmit=function(){if(a.FlatButton.isLocked(s))return!1;var e=window.submitQuickLoginForm;if(!e)return!0;var t=l?l.value.trim():"",r=u?u.value.trim():"",i=Number((0,o.isChecked)(n));if(l&&!t)return(0,o.notaBene)(l),!1;if(!r)return(0,o.notaBene)(u),!1;var c={expire_input:i};return d&&d.value&&(c.ul=d.value),e(t,r,{prg:"login_button",params:c}),a.FlatButton.lock(s),!1},requestAnimationFrame((function(){var e;null===(e=l||u)||void 0===e||e.focus()})))}},e}()},99937:(e,t,n)=>{"use strict";n.d(t,{LoginRecentUsersGallery:()=>o});var r=n(70655),o=function(){function e(e){this.containerEl=e,this.viewportEl=e.firstElementChild,this.layerEl=this.viewportEl.firstElementChild,this.initializeSlides()}return e.prototype.init=function(){this.setIndex(0)},e.prototype.initializeSlides=function(){var e;this.slides=(0,r.__spreadArray)([],(0,r.__read)(this.layerEl.children)).map((function(e,t){return{coordX:t*e.offsetWidth,width:e.offsetWidth,el:e}})),this.viewportEl.style.width=(null===(e=this.slides[0])||void 0===e?void 0:e.width)+"px";var t=this.containerEl.offsetWidth,n=this.viewportEl.offsetWidth;this.layerWidth=this.slides.reduce((function(e,t){return t.width+e}),0),this.min=n-(t-n)/2-this.layerWidth,this.max=0},e.prototype.validateIndent=function(e){var t=this.min,n=this.max;return e<t?t:e>n?n:e},e.prototype.calculateIndent=function(e){var t=this.slides,n=t.length?t[e]:null;if(n){var r=n.coordX;return this.validateIndent(-1*r)}return 0},e.prototype.render=function(){var e=this,t=this.calculateIndent(this.currentIndex);requestAnimationFrame((function(){e.layerEl.style.transform="translateX("+t+"px)"})),(0,r.__spreadArray)([],(0,r.__read)(this.layerEl.children)).forEach((function(t,n){t.classList.toggle("LoginRecentUsersGallery__slide--prev2",n===e.currentIndex-2),t.classList.toggle("LoginRecentUsersGallery__slide--active",n===e.currentIndex),t.classList.toggle("LoginRecentUsersGallery__slide--next2",n===e.currentIndex+2)}))},e.prototype.setRelativeIndex=function(e){this.currentIndex=Math.max(0,Math.min(this.currentIndex+e,this.slides.length-1)),this.onChange(this.currentIndex),this.render()},e.prototype.setIndex=function(e){this.currentIndex=Math.max(0,Math.min(e,this.slides.length-1)),this.onChange(this.currentIndex),this.render()},e}()},74402:(e,t,n)=>{"use strict";n.d(t,{MARKET_EVENT_COUNTER_SECTION_ID:()=>o,updateMarketMenuEventCounter:()=>i});var r=n(64702),o="page_menu_group_market";function i(e,t){var n=document.querySelector(e);n&&r.PageActionCell.setCounter(n,t)}},60717:(e,t,n)=>{"use strict";n.d(t,{highlightModule:()=>l});var r,o,i=n(1261),a=n(35429),s=n(3834),c=n(15544);function l(e){var t,n=document.getElementById(e.module);if(n&&n.classList.contains("module")){window.cur.__narrowBarForceNotFixed=!0;var l=e.speed?e.speed:300;(0,s.scrollToY)((0,c.getXY)(n)[1]-100,l);var u=function(){r&&(r.hideTT(),(0,s.enableBodyScroll)(),delete window.cur.__narrowBarForceNotFixed,(0,a.updateNarrow)(),e.onClose&&e.onClose())};(r=new i.default(n,e.text,{highlight:!0,width:250,offset:[0,-17],side:"bottom",withCloseButton:!0,onBGClick:u,onCloseButtonClick:u})).show(),(0,s.disableBodyScroll)(),e.autoCancelDelay&&(o=setTimeout((function(){u(),o=null}),e.autoCancelDelay),null===(t=window.cur.destroy)||void 0===t||t.push((function(){o&&clearTimeout(o)})))}}},56901:(e,t,n)=>{"use strict";n.d(t,{PROFILE_MEDIA_NARROW_BLOCK_ID:()=>r});var r="profile_media_narrow_block"},23459:(e,t,n)=>{"use strict";n.d(t,{showMyQuestionsBox:()=>d,showAskQuestionBox:()=>_});var r=n(70655),o=n(15544),i=n(86125),a=n(51888),s=n(35779),c=n(19331),l=n(64260),u=n(34234);function d(e){var t;if((0,c.partConfigEnabled)("profile_questions_enabled"))if(window.cur.viewAsBox)window.cur.viewAsBox();else if(!(null===(t=window.MyQuestionsBox)||void 0===t?void 0:t.isMounted())){(null==e?void 0:e.ref)&&(0,u.logQuestionsOpeningEvent)(window.vk.id,e.ref,l.QuestionAnalyticBoxName.myQuestions);var n=document.querySelector("#box_layer_wrap"),d=document.querySelector("#box_loader");(0,o.show)(n),(0,o.show)(d),(0,i.boxRefreshCoords)(d),Promise.all([(0,a.getQuestions)(),window.stManager.add([window.jsc("web/my_questions.js")]),new Promise((function(e,t){window.ajax.post("al_questions.php",{act:"load_ask_my_questions_box_lang_keys"},{onDone:function(){e()},onFail:function(){return t(),!0}})}))]).then((function(t){var i=(0,r.__read)(t,1)[0];window.boxQueue.count()||(0,o.hide)(n),(0,o.hide)(d),window.MyQuestionsBox.init(i.count,i.items,i.profiles,i.next_from,{onClose:null==e?void 0:e.onClose,fromElement:null==e?void 0:e.fromElement})})).catch((function(e){(0,o.hide)(n),(0,o.hide)(d),(0,s.logQuestionError)(e,"An error occurred while loading data for my_questions.js")}))}}function _(e,t){var n;if((0,c.partConfigEnabled)("profile_questions_enabled"))if(e!==window.vk.id){if(window.cur.viewAsBox)window.cur.viewAsBox();else if(!(null===(n=window.AskQuestionBox)||void 0===n?void 0:n.isMounted()))if(e){(null==t?void 0:t.ref)&&(0,u.logQuestionsOpeningEvent)(e,t.ref,l.QuestionAnalyticBoxName.askQuestion);var _=document.querySelector("#box_layer_wrap"),p=document.querySelector("#box_loader");(0,o.show)(_),(0,o.show)(p),(0,i.boxRefreshCoords)(p),Promise.all([(0,a.getUsers)([e]),window.stManager.add([window.jsc("web/ask_question.js")]),new Promise((function(e,t){window.ajax.post("al_questions.php",{act:"load_ask_question_box_lang_keys"},{onDone:function(){e()},onFail:function(){return t(),!0}})}))]).then((function(e){var n=(0,r.__read)(e,1)[0];(0,o.hide)(_),(0,o.hide)(p);var i=n[0];i&&window.AskQuestionBox.init(i,null==t?void 0:t.fromElement)})).catch((function(e){(0,o.hide)(_),(0,o.hide)(p),(0,s.logQuestionError)(e,"An error occurred while loading data for ask_question.js")}))}else(0,s.logQuestionError)("Empty toUserId has been passed to showAskQuestionBox")}else d({ref:null==t?void 0:t.ref,fromElement:null==t?void 0:t.fromElement})}},8706:(e,t,n)=>{"use strict";n.d(t,{previewVisibilityUseCurrent:()=>r});n(4608);var r={kind:"useCurrent"}},4608:(e,t,n)=>{"use strict";n.d(t,{PreviewVariantActionStatusBar:()=>r,PreviewVariantHidden:()=>o,PreviewVariants:()=>i});var r="action_status_bar",o="hidden",i=[r,o]},95146:(e,t,n)=>{"use strict";n.d(t,{SUPPORTED_OBJECT_TYPES:()=>r,REACTIONS_COUNTS_RESPONSE_FIELD:()=>o});var r={wall:"wall",wall_reply:"wall_reply"},o="reactions_counts"},65872:(e,t,n)=>{"use strict";n.d(t,{reactionsCountsUpdatePayload:()=>i,reactionsCountsOnlyUpdatePayload:()=>a});var r=n(70655),o=n(71904),i=function(e,t){return(0,r.__assign)((0,r.__assign)({kind:o.PayloadKindFull},e),{reactionIdState:{reactionId:t.id}})},a=function(e){return(0,r.__assign)({kind:o.PayloadKindCountsOnly},e)}},71904:(e,t,n)=>{"use strict";n.d(t,{PayloadKindCountsOnly:()=>r,PayloadKindFull:()=>o});var r="counts_only",o="counts_with_current_reaction"},7337:(e,t,n)=>{"use strict";n.d(t,{triggerReactionsUpdate:()=>s});var r=n(65864),o=n(95146),i=n(53580),a=n(65872),s=function(e,t,n,s){var c=(0,r.parseLikeObjectId)(e);c&&c.objectType===o.SUPPORTED_OBJECT_TYPES.wall&&c.objectId?(0,i.emitEvent)(i.WallDataEvents.post_reactions_counts_update,function(e,t,n,r){var o={counts:e,isFromWkLayer:null==t?void 0:t.isFromWkLayer,isPrimaryLikeButtonClick:null==t?void 0:t.isPrimaryLikeButtonClick,isQueueUpdate:null==t?void 0:t.isQueueUpdate,isUserAction:t.isUserAction,postFullId:n.objectId,previewVisibility:t.previewVisibility,reactionIdState:r?{reactionId:r.id}:void 0};return r?(0,a.reactionsCountsUpdatePayload)(o,r):(0,a.reactionsCountsOnlyUpdatePayload)(o)}(t,s,c,n)):c&&c.objectType===o.SUPPORTED_OBJECT_TYPES.wall_reply&&c.objectId?(0,i.emitEvent)(i.WallDataEvents.reply_reactions_counts_update,{counts:t,replyFullId:c.objectId,reactionIdState:n?{reactionId:n.id}:void 0}):console.warn("Unsupported reactions object update",e)}},13981:(e,t,n)=>{"use strict";n.d(t,{initColorSchemeDropdowns:()=>i});var r=n(70655),o=n(11417);function i(){document.querySelectorAll(".SettingsColorSchemeDropdown").forEach((function(e){!function(e){if(!e.dataset.inited){e.dataset.inited="1";var t=e.dataset.value,n=JSON.parse(e.dataset.items||"[]");o.ColorScheme.isSchemesAutoSwitchingSupported()||(t===o.ColorSchemeMode.Auto&&(t=o.ColorSchemeMode.Light),n=n.filter((function(e){return(0,r.__read)(e,1)[0]!==o.ColorSchemeMode.Auto})));var i=new window.InlineDropdown(e,{selected:t,items:n,onSelect:function(t){o.colorScheme.setMode(t);var n=e.dataset.hash;window.ajax.post("al_settings.php?act=a_save_color_scheme_mode",{mode:t,hash:n})}}),a=o.colorScheme.subscribe((function(){e&&i?i.val(o.colorScheme.getMode(),!0):a()}))}}(e)}))}},14200:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var r=n(40906),o=n(41926),i=n(52745),a=n(49464),s=n(47612),c=n(25696);const l=function(){function e(){var e=this;this.destroy=function(){e.gallery&&e.gallery.destroy()},this.moduleEl=document.querySelector(".narratives_module"),this.isWide=this.moduleIsWide(this.moduleEl),this.initGallery(),this.needOnBoard()&&this.showOnboardTooltipIfNeeded(),window.cur.destroy&&window.cur.destroy.push((function(){e.destroy()}))}return e.prototype.initGallery=function(){if(this.isWide&&(this.galleryEl=document.querySelector(".NarrativeBlock"),this.galleryEl)){var e=this.galleryEl.querySelectorAll(".ui_gallery_item"),t={scrollY:!1};(!e||e.length<7)&&(t.scrollX=!1),this.gallery=new s.UIGallery(this.galleryEl,t)}},e.prototype.moduleIsWide=function(e){if(e){var t=e.getAttribute("data-is-wide");return!!(0,r.intval)(t)}return!1},e.prototype.getOnboardHash=function(){var e;return null===(e=this.moduleEl)||void 0===e?void 0:e.dataset.onboardHash},e.prototype.openNarrativeBox=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;this.showBox(),(0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.openNarrativeList,{ownerId:e},t)},e.prototype.seeMore=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;this.showBox(),(0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.seeMore,{ownerId:e},t)},e.prototype.showBox=function(){var e=this.getOwnerId(),t={ownerId:e,onSave:function(){return(0,i.updateNarrativeBlock)()},onRemove:function(){return(0,i.updateNarrativeBlock)()},onReorder:function(){return(0,i.updateNarrativeBlock)()},navScreen:e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club};(0,o.showNarrativeBox)(t)},e.prototype.showNarrativeEditorBox=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;if((0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.createNarrative,{ownerId:e},t),e<0)window.nav.go(location.pathname+"?act=narrative_create");else{var n={onSave:function(){return(0,i.updateNarrativeBlock)()},navScreen:t};(0,o.showNarrativeEditorBox)(e,n)}},e.prototype.getOwnerId=function(){return(0,r.intval)(window.cur.oid)},e.prototype.showOnboardTooltipIfNeeded=function(){var e=this.getOnboardHash();e&&(window.cur.storyLayer&&c.hideAllLayers(!0),window.boxQueue.hideAll(),(0,i.highlightNarrativeBlock)(e))},e.prototype.needOnBoard=function(){return Boolean(window.cur.needNarrativeOnboard)},e}()},94538:(e,t,n)=>{"use strict";n.d(t,{InputWithPrefix:()=>s});var r=n(70655),o=n(67294),i=n(83295),a=n(86409),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputRef=o.createRef(),t.componentRef=o.createRef(),t}return(0,r.__extends)(t,e),t.prototype.notaBene=function(){var e,t=null===(e=this.componentRef)||void 0===e?void 0:e.current;t&&(0,a.notaBene)(t)},t.prototype.focus=function(){var e,t;null===(t=null===(e=this.inputRef)||void 0===e?void 0:e.current)||void 0===t||t.focus()},t.prototype.render=function(){var e=this.props,t=e.className,n=e.prefix,a=(0,r.__rest)(e,["className","prefix"]);return o.createElement("div",{className:(0,i.classNames)("InputWithPrefix",t),ref:this.componentRef},o.createElement("div",{className:"InputWithPrefix__text"},n),o.createElement("input",(0,r.__assign)({className:"InputWithPrefix__input"},a,{ref:this.inputRef})))},t}(o.Component)},15985:(e,t,n)=>{"use strict";n.d(t,{NarrativeBox:()=>D});var r=n(70655),o=n(67294),i=n(41929),a=n(88420),s=n(41650),c=n(2119),l=n(9652),u=n(13165),d=n(85597),_=n(87142),p=n(39664),h=n(41926),f=n(86125),m=n(40906),g=n(64891),v=n(53449),y=n(50167),E=n(42041),w=n(9542),b=n(17173),C=n(81536),S=n(15653),T=n(49464),D=function(e){function t(t){var n=e.call(this,t)||this;return n.getBoxActionButtons=function(){var e=n.props,t=e.onClose,r=e.boxData,i=e.type,c=[o.createElement(a.default,{key:"close",appearance:"primary",onClick:function(){return t()}},(0,s.getLang)("global_close"))];if(i===l.BoxType.edit&&r.userId===r.ownerId){var u=r.ownerDomain||"id"+r.userId;c.unshift(o.createElement(g.default,{key:"archive",href:u+"?w=stories",onClick:function(){t(),(0,y.showWiki)({w:"stories"})},className:"NarrativeBox__additionalFooterButton"},(0,s.getLang)("stories_archive")))}return c},n.onNarrativeClick=function(e,t){if(!e.ctrlKey&&!e.metaKey){e.preventDefault(),e.stopPropagation();var r=n.props.list?n.props.list:"narrative"+t.ownerId+"_"+t.id;(0,u.showNarrative)(t.ownerId,t.id,0,r,{trackCode:n.props.trackCode,source:n.props.source})}},n.onCreateNarrativeClick=function(){var e=n.props,t=e.boxData,r=e.navScreen,o=t.ownerId;if((0,T.sendNarrativeAnalytic)(T.NarrativeAnalyticEventType.createNarrative,{ownerId:o},r),o>0)n.openNarrativeEditorBox();else{var i=t.ownerDomain?t.ownerDomain:"club"+-o;window.open("https://"+location.hostname+"/"+i+"?act=narrative_create")}},n.openNarrativeEditorBox=function(e){var t=n.props,o=t.onSave,i=t.boxData,a=t.onClose,s=t.navScreen;if(o){var c=[];(null==e?void 0:e.stories.length)&&(c=(0,r.__spreadArray)([],(0,r.__read)(e.stories)));var l={narrative:e,selectedStories:c,publishHash:i.publishHash,onSave:function(e){o(e),a()},navScreen:s};(0,h.showNarrativeEditorBox)(i.ownerId,l)}},n.getNarrativeItemActions=function(e){var t=[];if(n.canEdit())t.push({text:(0,s.getLang)("global_edit"),onClick:function(){return n.editNarrative(e)}}),t.push({text:(0,s.getLang)("stories_share"),onClick:function(){return n.shareNarrative(e)}}),t.push({separator:!0}),t.push({text:(0,s.getLang)("global_delete"),onClick:function(){return n.removeNarrative(e)}});else{var r=e.isBookmarked?(0,s.getLang)("global_remove_from_bookmarks"):(0,s.getLang)("global_add_to_bookmarks");t.push({text:r,onClick:function(){return n.bookmarkNarrative(e)}}),t.push({text:(0,s.getLang)("stories_share"),onClick:function(){return n.shareNarrative(e)}})}return t},n.state={isLoad:!1,draggingNarrativeRawId:""},n.scrollContainerRef=o.createRef(),n.gridRef=o.createRef(),n.sentinelRef=o.createRef(),n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.narratives,r=t.onClose,a=t.boxData,s=this.state,c=s.isLoad,l=s.draggingNarrativeRawId,u=n.length<a.count,_=this.canEdit();return o.createElement(i.BoxModal,{className:"NarrativeBox",title:this.getTitle(),actionButtons:this.getBoxActionButtons(),onClose:r,hasScroll:!1},o.createElement("div",{className:"NarrativeBox__scrollContainer",ref:this.scrollContainerRef},o.createElement("div",{className:"NarrativeBox__scrollInner"},o.createElement("div",{className:"NarrativeBox__list",ref:this.gridRef},_&&o.createElement(o.Fragment,null,o.createElement(d.NarrativeRowCreation,{key:"create",onClick:this.onCreateNarrativeClick}),n.map((function(t){return o.createElement(w.NarrativeRow,{className:b.BOX_ITEM_DRAGGABLE_CLASS,narrative:t,key:t.rawId,onClick:function(n){return e.onNarrativeClick(n,t)},aside:o.createElement("div",{className:"NarrativeBox__aside"},t.rawId===l&&o.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},o.createElement(C.default,null)),t.rawId!==l&&o.createElement(v.default,{position:"b",align:"center",trigger:"hover",data:e.getNarrativeItemActions(t)},o.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},o.createElement(C.default,null))),o.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--burger"},o.createElement(S.default,null)))})}))),!_&&o.createElement(o.Fragment,null,n.map((function(t){return o.createElement(w.NarrativeRow,{narrative:t,key:t.rawId,onClick:function(n){return e.onNarrativeClick(n,t)},aside:o.createElement("div",{className:"NarrativeBox__aside"},o.createElement(v.default,{position:"b",align:"right",trigger:"hover",data:e.getNarrativeItemActions(t)},o.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},o.createElement(C.default,null))))})})))),c&&o.createElement("div",{className:"NarrativeBox__loader",key:"loader"},o.createElement(p.default,null)),u&&o.createElement("div",{className:"NarrativeBox__sentinel",ref:this.sentinelRef}))))},t.prototype.canEdit=function(){var e=this.props,t=e.type,n=e.onSave,r=e.onReorder,o=e.onRemove;return t===l.BoxType.edit&&Boolean(n)&&Boolean(r)&&Boolean(o)},t.prototype.componentDidMount=function(){this.initSorter(),this.observeNarrativeScrollIfNeeded()},t.prototype.componentWillUnmount=function(){this.deInitSorter(),this.unObserveNarrativeScrollIfNeeded()},t.prototype.editNarrative=function(e){var t=this.props.boxData;(0,T.sendNarrativeAnalytic)(T.NarrativeAnalyticEventType.clickToEditNarrative,e,this.props.navScreen),t.ownerId>0?this.openNarrativeEditorBox(e):window.open("https://"+location.hostname+location.pathname+"?act=narrative_edit&nid="+e.id)},t.prototype.shareNarrative=function(e){E.Likes.share("narrative"+e.rawId),(0,T.sendNarrativeAnalytic)(T.NarrativeAnalyticEventType.shareNarrative,e,this.props.navScreen)},t.prototype.bookmarkNarrative=function(e){var t=this.props.onBookmark;(0,y.bookmark)(e.ownerId,e.id,"narrative",e.bookmarkHash,e.isBookmarked),(0,T.sendNarrativeAnalytic)(T.NarrativeAnalyticEventType.addToBookmarks,e,this.props.navScreen),t(e)},t.prototype.removeNarrative=function(e){var t,n;null===(n=(t=this.props).onRemove)||void 0===n||n.call(t,e)},t.prototype.observeNarrativeScrollIfNeeded=function(){var e=this,t=this.props,n=t.narratives,r=t.boxData;if(n.length<r.count){var o=this.scrollContainerRef.current,i=this.sentinelRef.current;if(!i)return;this.observer=new IntersectionObserver((function(t){t.forEach((function(t){t.intersectionRatio>0&&e.loadViewers()}))}),{threshold:[0],root:o,rootMargin:"0px 0px 480px 0px"}),this.observer.observe(i)}},t.prototype.unObserveNarrativeScrollIfNeeded=function(){this.observer&&this.observer.disconnect()},t.prototype.loadViewers=function(){var e=this,t=this.props.loadMore;this.state.isLoad||(this.setState({isLoad:!0}),t().finally((function(){e.setState({isLoad:!1})})))},t.prototype.initSorter=function(){var e,t,n=this,r=this.props.boxData;if(this.canEdit()){var o=null===(e=this.scrollContainerRef)||void 0===e?void 0:e.current,i=null===(t=this.gridRef)||void 0===t?void 0:t.current;if(i&&o){var a={dragThreshold:0,wrapNode:o,onDragFinish:function(){n.setState({draggingNarrativeRawId:""})},onDragStart:function(e){var t=n.getNarrativeIdByEl(e);n.setState({draggingNarrativeRawId:r.ownerId+"_"+t})},onReorder:function(e){var t=n.getNarrativeIdByEl(e),r=Array.from(i.querySelectorAll("."+b.BOX_ITEM_DRAGGABLE_CLASS));if(1!==r.length){var o=0,a=0,s=r.findIndex((function(e){return n.getNarrativeIdByEl(e)===t}));r[s-1]&&(o=n.getNarrativeIdByEl(r[s-1])),r[s+1]&&(a=n.getNarrativeIdByEl(r[s+1])),n.saveReorder(t,a,o)}}};this.sorter=new _.default(i,"",a)}}},t.prototype.saveReorder=function(e,t,n){var r=this,o=this.props,i=o.boxData,a=o.onReorder;if(a){var c=i.ownerId;window.ajax.post("al_stories.php",{act:"narratives_reorder",narrative_id:e,before_narrative_id:t,after_narrative_id:n,hash:i.reorderHash,owner_id:c},{onDone:function(){var t,n=r.props.narratives,o=null===(t=r.gridRef)||void 0===t?void 0:t.current;if(o){var i=Array.from(o.querySelectorAll("."+b.BOX_ITEM_DRAGGABLE_CLASS)),s=[];i.forEach((function(e){var t=r.getNarrativeIdByEl(e),o=n.find((function(e){return e.id===t}));o&&s.push(o)})),(0,T.sendNarrativeAnalytic)(T.NarrativeAnalyticEventType.changeSort,{ownerId:c,id:e},r.props.navScreen),a(s)}},onFail:function(e){return(0,f.showDoneBox)(e||(0,s.getLang)("global_error")),!0}})}},t.prototype.getNarrativeIdByEl=function(e){return(0,m.intval)(e.getAttribute("data-id"))},t.prototype.getTitle=function(){var e=this.props,t=e.title,n=e.boxData,r=e.showNarrativeNumber;return o.createElement(c.NarrativeBoxTitle,{title:t||(0,s.getLang)("stories_narratives_title"),count:n.count,showNarrativeNumber:r})},t.prototype.deInitSorter=function(){this.sorter&&this.sorter.destroy()},t.defaultProps={type:l.BoxType.view,showNarrativeNumber:!0},t}(o.Component)},9652:(e,t,n)=>{"use strict";var r;n.d(t,{BoxType:()=>r}),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(r||(r={}))},2119:(e,t,n)=>{"use strict";n.d(t,{NarrativeBoxTitle:()=>o});var r=n(67294),o=function(e){var t=e.title,n=e.count,o=void 0===n?0:n,i=e.showNarrativeNumber,a=void 0===i||i;return r.createElement("div",{className:"NarrativeBoxTitle"},t,a&&o>0&&r.createElement("span",{className:"NarrativeBoxTitle__count"},o))}},44451:(e,t,n)=>{"use strict";n.d(t,{NarrativeChooseBox:()=>v});var r=n(70655),o=n(67294),i=n(41929),a=n(88420),s=n(41650),c=n(18690),l=n(83295),u=n(23985),d=n(85597),_=n(9542),p=n(86125),h=n(41926),f=n(13165),m=n(38046),g=n(49464),v=function(e){function t(t){var n=e.call(this,t)||this;return n.loadMore=function(){var e=n.props,t=e.loadMore,o=e.story,i=n.state.selectedNarrativeIds;return t().then((function(e){void 0===e&&(e=[]),n.setState({selectedNarrativeIds:(0,r.__assign)((0,r.__assign)({},i),n.getSelectedNarrativeIdsMap(o.id,e))})}))},n.onCheckboxClick=function(e){var t=n.state.selectedNarrativeIds,o=(0,r.__assign)({},t);o[e.id]?delete o[e.id]:o[e.id]=!0,n.setState({selectedNarrativeIds:o})},n.getBoxActionButtons=function(){var e=n.props,t=e.onClose,r=e.story,i=e.narratives,l=n.state,u=l.isLoad,d=l.selectedNarrativeIds,_=n.getSelectedNarrativeIdsMap(r.id,i),p=n.getDiffOperations(r.id,d,_);return[o.createElement(a.default,{key:"close",appearance:"tertiary",onClick:function(){return t()}},(0,s.getLang)("global_close")),o.createElement(c.default,{key:"save",appearance:"primary",disabled:!p.length,onClick:n.save,loading:u},(0,s.getLang)("global_save"))]},n.save=function(){var e=n.props,t=e.story,r=e.narratives,o=e.boxData,i=e.onClose,a=e.onSave,c=e.navScreen,l=n.state.selectedNarrativeIds,u=n.getSelectedNarrativeIdsMap(t.id,r),d=n.getDiffOperations(t.id,l,u),_=Boolean(Object.keys(l).length),h=o.ownerId;n.setState({isLoad:!0}),window.ajax.post("al_stories.php",{act:"batch_edit",owner_id:h,operations:JSON.stringify(d),hash:o.editHash},{onDone:function(){a(_),i(),(0,g.sendNarrativeAnalytic)(g.NarrativeAnalyticEventType.addStoryToNarrative,{ownerId:h},c),(0,p.showDoneBox)(n.getDoneText(d))},onFail:function(e){return(0,p.showDoneBox)(e||(0,s.getLang)("global_error")),!0},hideProgress:function(){n.setState({isLoad:!1})}})},n.onCreateNarrativeClick=function(){var e=n.props,t=e.story,r=e.narratives,o=e.onSave,i=e.onClose,a=e.boxData,s=e.navScreen,c=a.ownerId;if(c>0){var l=n.getSelectedNarrativeIdsMap(t.id,r),u=Boolean(Object.keys(l).length),d={selectedStories:[t],onSave:function(){u=!0},onClose:function(){o(u),i()},navScreen:s};return(0,h.showNarrativeEditorBox)(c,d),void(0,g.sendNarrativeAnalytic)(g.NarrativeAnalyticEventType.createNarrative,{ownerId:c},s)}var _=a.ownerDomain?a.ownerDomain:"club"+-a.ownerId;window.nav.go(_+"?act=narrative_create&story_id="+t.id)},n.onNarrativeClick=function(e,t){e.ctrlKey||e.metaKey||((0,f.showNarrative)(t.ownerId,t.id,0,"narrative"+t.ownerId+"_"+t.id),e.preventDefault(),e.stopPropagation())},n.state={isLoad:!1,selectedNarrativeIds:n.getSelectedNarrativeIdsMap(t.story.id,t.narratives)},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.onClose,r=t.narratives,a=t.boxData,c=this.state.selectedNarrativeIds,p=r.length<a.count;return o.createElement(i.BoxModal,{className:"NarrativeChooseBox",title:(0,s.getLang)("stories_narrative_choosing"),actionButtons:this.getBoxActionButtons(),onClose:n,hasScroll:!1,appearance:"blue"},o.createElement(u.default,{className:"NarrativeChooseBox__list",itemHeight:80,loadMore:this.loadMore,hasMore:p},o.createElement(d.NarrativeRowCreation,{key:"create",onClick:this.onCreateNarrativeClick,clickable:!0,size:50}),r.map((function(t){return o.createElement(_.NarrativeRow,{narrative:t,key:t.rawId,onClick:function(){return e.onCheckboxClick(t)},size:50,noBorder:!0,clickable:!0,aside:o.createElement("div",{className:(0,l.classNames)("NarrativeChooseBox__checkbox",{"NarrativeChooseBox__checkbox--checked":c[t.id]})})})}))))},t.prototype.getDoneText=function(e){var t=e.filter((function(e){return e.op===m.BatchOperationType.Add})).length;if(t>1)return(0,s.getLang)("stories_saved_in_narratives_text");if(1===t)return(0,s.getLang)("stories_saved_in_narrative_text");var n=e.filter((function(e){return e.op===m.BatchOperationType.Delete})).length;return n>1?(0,s.getLang)("stories_deleted_in_narratives_text"):1===n?(0,s.getLang)("stories_deleted_in_narrative_text"):(0,s.getLang)("stories_settings_saved")},t.prototype.getDiffOperations=function(e,t,n){var r=[];return Object.keys(t).forEach((function(t){n[t]||r.push({op:m.BatchOperationType.Add,story_id:e,narrative_id:Number(t)})})),Object.keys(n).forEach((function(n){t[n]||r.push({op:m.BatchOperationType.Delete,story_id:e,narrative_id:Number(n)})})),r},t.prototype.getSelectedNarrativeIdsMap=function(e,t){return t.reduce((function(t,n){return n.stories.find((function(t){return t.id===e}))&&(t[n.id]=!0),t}),{})},t}(o.Component)},33623:(e,t,n)=>{"use strict";n.d(t,{MAX_THUMB_HEIGHT:()=>p,MAX_THUMB_WIDTH:()=>h,NarrativeCoverCropper:()=>f});var r=n(70655),o=n(67294),i=n(41929),a=n(88420),s=n(41650),c=n(43390),l=n(54612),u=n(66433),d=n(18690),_=n(61540),p=604,h=468,f=function(e){function t(t){var n=e.call(this,t)||this;return n.onSaveCrop=function(){var e=n.props,t=e.onSave,r=e.onClose,o=e.coverUrl,i=n.crop;i&&(n.setState({isLoading:!0}),(0,_.getCroppedImage)(o,i.left,i.top,i.width,i.height).then((function(e){return t(n.getCropForSaving(i),e.src)})).then(r).catch((function(e){n.setState({isLoading:!1}),(0,l.showFastBox)((0,s.getLang)("global_error"),e||(0,s.getLang)("global_unknown_error")),console.error(e),(0,u.logError)(new Error("error with onSaveCrop"+(e?": "+e:"")))})))},n.onCropUpdate=function(e){n.crop=e},n.state={isLoading:!1},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,n=e.coverUrl,r=e.coverHeight,l=e.coverWidth,u=e.thumbHeight,_=e.thumbWidth,p=e.crop,h=this.state.isLoading;return o.createElement(i.BoxModal,{className:"NarrativeCoverCropper",appearance:"white",title:(0,s.getLang)("stories_cover_cropper_title"),onClose:t,hasScroll:!1},o.createElement("div",{className:"NarrativeCoverCropper__inner"},o.createElement("div",{className:"NarrativeCoverCropper__info"},o.createElement("div",null,(0,s.getLang)("stories_cover_cropper_info_1")),o.createElement("div",null,(0,s.getLang)("stories_cover_cropper_info_2"))),o.createElement("div",{className:"NarrativeCoverCropper__frame"},o.createElement(c.PhotoAreaSelector,{className:"NarrativeCoverCropper__tagger",imgSrc:n,imgHeight:r,imgWidth:l,previewHeight:u,previewWidth:_,minHeight:75,minWidth:75,isSquare:!0,preview100:!0,cropRect:this.getCropForTagger(p),onCropUpdated:this.onCropUpdate})),o.createElement("div",{className:"NarrativeCoverCropper__footer"},o.createElement(d.default,{loading:h,onClick:this.onSaveCrop},(0,s.getLang)("stories_cover_next")),o.createElement(a.default,{disabled:h,appearance:"secondary",onClick:t},(0,s.getLang)("stories_cover_back")))))},t.prototype.getCropForTagger=function(e){var t,n=this.props,r=n.coverWidth,o=n.coverHeight;if(e){var i=Math.round(e.width*r),a=Math.round(e.height*o);if(Math.abs(a-i)>1)return t;a=i,t={top:Math.round(e.y*o),left:Math.round(e.x*r),width:i,height:a}}return t},t.prototype.getCropForSaving=function(e){var t=this.props,n=t.coverWidth,r=t.coverHeight;return{y:e.top/r,x:e.left/n,width:e.width/n,height:e.height/r}},t}(o.Component)},84215:(e,t,n)=>{"use strict";n.d(t,{NarrativeCreateLiteBox:()=>p});var r=n(70655),o=n(67294),i=n(41650),a=n(18690),s=n(41929),c=n(95724),l=n(17173),u=n(49062),d=n(51907),_=n(86409),p=function(e){function t(t){var n=e.call(this,t)||this;return n.onNameChange=function(e){var t=e.target.value,r=(0,c.trim)(t)?t:"";n.setState({name:r})},n.getBoxActionButtons=function(){var e=n.state.isLoad;return[o.createElement(a.default,{key:"publish",appearance:"primary",onClick:n.save,loading:e},(0,i.getLang)("groups_edit_narrative_publish"))]},n.save=function(){var e=n.state.isLoad,t=n.state.name,r=void 0===t?"":t;e||((r=(0,c.trim)(r))?(n.setState({isLoad:!0}),n.props.onSave(r).catch((function(){n.setState({isLoad:!1})}))):(0,_.notaBene)(n.nameInputRef.current))},n.state={isLoad:!1,name:"",coverStory:t.stories[0]},n.nameInputRef=o.createRef(),n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,n=e.ownerName,r=e.stories,a=this.state,c=a.name,_=a.coverStory,p=null==_?void 0:_.preview;return o.createElement(s.BoxModal,{className:"NarrativeCreateLiteBox",title:(0,i.getLang)("stories_creating_narrative"),actionButtons:this.getBoxActionButtons(),onClose:t,hasScroll:!1,appearance:"blue"},o.createElement("div",{className:"NarrativeCreateLiteBox__inner"},o.createElement("div",{className:"NarrativeCreateLiteBox__title"},(0,i.getLang)("groups_edit_narrative_title")),o.createElement("input",{type:"text",className:"NarrativeCreateLiteBox__nameInput",value:c,onChange:this.onNameChange,placeholder:(0,i.getLang)("stories_enter_name"),maxLength:l.NARRATIVE_MAX_TITLE_LENGTH,ref:this.nameInputRef,autoFocus:!0}),o.createElement("div",{className:"NarrativeCreateLiteBox__title"},(0,i.getLang)("groups_edit_narrative_preview")),o.createElement("div",{className:"NarrativeCreateLiteBox__text"},(0,i.getLang)("groups_edit_narrative_pin_text")),o.createElement("div",{className:"NarrativeCreateLiteBox__previews"},o.createElement("div",{className:"NarrativeCreateLiteBox__previewWrapper"},o.createElement("div",{className:"NarrativeCreateLiteBox__previewTitle"},(0,i.getLang)("stories_narrative_preview_block_title")),o.createElement("div",{className:"NarrativeCreateLiteBox__smallPreview"},o.createElement(u.NarrativeItemPreviewCover,{cover:p}),o.createElement("span",{className:"NarrativeCreateLiteBox__smallPreviewName"},c||(0,i.getLang)("stories_narrative_name_full")))),o.createElement("div",{className:"NarrativeCreateLiteBox__previewWrapper NarrativeCreateLiteBox__previewWrapper--snippet"},o.createElement("div",{className:"NarrativeCreateLiteBox__previewTitle"},(0,i.getLang)("stories_narrative_preview_feed_title")),o.createElement(d.NarrativeSnippet,{className:"NarrativeCreateLiteBox__snippet",ownerName:n,coverUrl:p,title:c,storyCount:r.length})))))},t}(o.Component)},11898:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditor:()=>E});var r=n(70655),o=n(67294),i=n(41650),a=n(87157),s=n(88420),c=n(86409),l=n(86125),u=n(18690),d=n(20516),_=n(56252),p=n(95724),h=n(41929),f=n(52745),m=n(95893),g=n(5101),v=n(49464),y=n(3562),E=function(e){function t(t){var n=e.call(this,t)||this;n.onSelectedStoriesUpdate=function(e){void 0===e&&(e=[]);var t=n.props.storyMap,r=n.state.cover,o=null==r?void 0:r.coverStoryId,i={selectedStoryIds:e};if((null==r?void 0:r.customPhotoId)||o&&e.includes(o))e.length||(i.cover=null);else{var a=e[0];e[0]?i.cover={url:t[a].preview,coverStoryId:a}:i.cover=null}n.setState(i)},n.openCoverSelection=function(){var e=n.state.cover;((null==e?void 0:e.coverStoryId)||(null==e?void 0:e.customPhotoId))&&n.setState({section:a.EditorSectionType.cover})},n.confirmCover=function(e){var t=n.state.cover;n.setState({cover:e||t,section:a.EditorSectionType.main})},n.onNameChange=function(e){var t=e.target.value,r=(0,p.trim)(t)?t:"";n.setState({name:r})},n.close=function(e,t){var o=n.props,i=o.ownerId,a=o.narrativeRawId,s=o.navScreen;if(!e){var c="";a&&(c=(0,r.__read)(a.split("_"),2)[1]),(0,v.sendNarrativeAnalytic)(v.NarrativeAnalyticEventType.close,{ownerId:i,id:Number(c)},s)}n.props.close(t)},n.onSave=function(e){n.props.onSave(e)},n.getFooterButtons=function(){var e=n.props.type,t=n.state,r=t.selectedStoryIds,c=t.loading;return[o.createElement(s.default,{key:"close",appearance:"tertiary",onClick:function(){return n.close(!1)},disabled:c},(0,i.getLang)("global_cancel")),o.createElement(u.default,{loading:c,key:"save",onClick:n.save,disabled:0===r.length},e===a.EditorModeType.edit?(0,i.getLang)("global_save"):(0,i.getLang)("stories_create_narrative"))]},n.save=function(){var e=n.props,t=e.publishHash,o=e.editHash,s=e.type,u=e.navScreen,d=e.ownerId,_=n.state,h=_.cover,m=_.loading,g=n.getSelectedStories(),y=n.state.name,E=void 0===y?"":y,w=n.props.narrativeRawId;if(!m)if(E=(0,p.trim)(E)){if((null==h?void 0:h.coverStoryId)||(null==h?void 0:h.customPhotoId)){var b="publish_narrative",C=t;s===a.EditorModeType.edit&&(b="edit_narrative",C=o);var S={act:b,owner_id:d,title:E,hash:C,story_ids:(0,f.prepareStoriesForPublishing)(g)};if(w){var T=(0,r.__read)(w.split("_"),2)[1];S.narrative_id=T}h.customPhotoId&&(S.custom_cover_photo_id=h.customPhotoId),h.coverStoryId&&(S.cover_story_id=h.coverStoryId),h.crop&&(S.crop_y=h.crop.y,S.crop_x=h.crop.x,S.crop_height=h.crop.height,S.crop_width=h.crop.width),window.ajax.post("al_stories.php",S,{onDone:function(e){w||(w=d+"_"+e);var t=n.getPublishDoneHtml(w,E,s);n.onSave(w),n.close(!0,(function(){return(0,l.showDoneBox)(t)})),(0,v.sendNarrativeAnalytic)(s===a.EditorModeType.edit?v.NarrativeAnalyticEventType.editNarrative:v.NarrativeAnalyticEventType.publishNarrative,{ownerId:Number(d),id:Number(e)},u)},onFail:function(e){return(0,l.showDoneBox)(e||(0,i.getLang)("global_error")),!0},hideProgress:function(){n.setState({loading:!1})}}),n.setState({loading:!0})}}else n.dataPanelRef.current&&(0,c.notaBene)(n.dataPanelRef.current.getInputEl())};var d=t.cover,_=t.selectedStoryIds[0];return!d&&_&&(d={url:t.storyMap[_].preview,coverStoryId:_}),n.state={tabKey:t.activeTabKey,name:t.name,selectedStoryIds:t.selectedStoryIds,cover:d,loading:!1,section:a.EditorSectionType.main},n.dataPanelRef=o.createRef(),n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this;return this.props.appearance===a.EditorViewType.box?o.createElement(h.BoxModal,{className:"NarrativeEditor NarrativeEditor--box",appearance:"blue",title:this.getBoxTitle(),onClose:function(){return e.close()},hasScroll:!1},this.renderInner()):o.createElement("div",{className:"NarrativeEditor NarrativeEditor--page"},this.renderInner())},t.prototype.renderInner=function(){var e=this.props,t=e.storyIds,n=e.storyMap,r=e.onStoryLinkUpdate,i=e.isEditingLinksAvailable,s=e.linkData,c=e.appearance,l=e.loadMore,u=e.hasMore,p=e.coverUploadConfig,h=e.ownerId,f=this.state,v=f.name,y=f.selectedStoryIds,E=f.cover,w=f.section,b=this.getSelectedStories(),C=(null==E?void 0:E.url)||"";return o.createElement("div",{className:"NarrativeEditor__inner"},w===a.EditorSectionType.main&&o.createElement(g.NarrativeEditorSection,{appearance:c,actionFooterButtons:this.getFooterButtons()},o.createElement(_.NarrativeEditorDataPanel,{className:"NarrativeEditor__dataPanel",coverUrl:C,name:v,selectedStoriesCount:y.length,onNameChange:this.onNameChange,onSubmit:this.save,onCoverClick:this.openCoverSelection,ref:this.dataPanelRef}),o.createElement(d.NarrativeEditorStoriesTabPanel,{appearance:c,onSelectedStoriesUpdate:this.onSelectedStoriesUpdate,storyIds:t,loadMore:l,hasMore:u,selectedStoryIds:y,storyMap:n,linkData:s,isEditingLinksAvailable:i,onStoryLinkUpdate:r})),w===a.EditorSectionType.cover&&o.createElement(m.NarrativeEditorCoverSection,{ownerId:h,appearance:c,cover:E,stories:b,onSave:this.confirmCover,coverUploadConfig:p,storyMap:n}))},t.prototype.getBoxTitle=function(){var e=this.props.type;return this.state.section===a.EditorSectionType.cover?(0,i.getLang)("stories_choose_cover_title"):e===a.EditorModeType.create?(0,i.getLang)("stories_creating_narrative"):(0,i.getLang)("stories_editing_narrative")},t.prototype.getPublishDoneHtml=function(e,t,n){var o=this.props.getPublishDoneHTML;if(o)return o(e,t,n);var s=(0,r.__read)(e.split("_"),2),c=s[0],l=s[1],u="if (!event.metaKey && !event.ctrlKey) { showNarrative("+Number(c)+", "+Number(l)+", 0, 'narrative"+e+"'); return false; }";return'\n      <div class="top_result_header">\n        '+(n===a.EditorModeType.create?(0,i.getLang)("stories_narrative_created"):(0,i.getLang)("stories_narrative_edited")).replace("{name}",'<a href="/narrative'+e+'" onclick="'+u+'">'+(0,p.clean)(t)+"</a>")+'\n      </div>\n      <a href="#" class="link" onclick="window.Likes.share(\'narrative'+e+"'); return false;\">"+(0,i.getLang)("stories_manage_share_narrative")+"</a>\n    "},t.prototype.getSelectedStories=function(){var e=this;return this.state.selectedStoryIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.componentWillUnmount=function(){this.revokeCustomUrls()},t.prototype.revokeCustomUrls=function(){var e=this.state.cover;e&&(0,y.isCustomCover)(e)&&[e.url,e.customPhotoOriginalUrl].forEach((function(e){(null==e?void 0:e.startsWith("blob:"))&&URL.revokeObjectURL(e)}))},t.defaultProps={name:"",type:a.EditorModeType.create,activeTabKey:a.EditorTabKey.selected,isEditingLinksAvailable:!1,appearance:a.EditorViewType.page},t}(o.Component)},87157:(e,t,n)=>{"use strict";var r,o,i,a;n.d(t,{EditorModeType:()=>r,EditorTabKey:()=>o,EditorViewType:()=>i,EditorSectionType:()=>a}),function(e){e[e.create=0]="create",e[e.edit=1]="edit"}(r||(r={})),function(e){e.all="all",e.selected="selected"}(o||(o={})),function(e){e.box="box",e.page="page"}(i||(i={})),function(e){e.main="main",e.cover="cover"}(a||(a={}))},88551:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorAllTab:()=>_});var r=n(70655),o=n(67294),i=n(87157),a=n(80528),s=n(98529),c=n(17173),l=n(59397),u=n(66433),d=n(39664),_=function(e){function t(t){var n=e.call(this,t)||this;return n.tabRef=o.createRef(),n.onScroll=function(){n.props.hasMore&&n.checkLoading()},n.checkLoading=(0,l.throttle)((function(){var e=n.props,t=e.loadMore,r=e.hasMore,o=n.state.isLoading,i=n.getScrollContainer(),a=n.getTabEl();r&&a&&(!o&&n.isMount&&(i instanceof HTMLElement?a.scrollTop+a.clientHeight>=a.scrollHeight-c.SCROLL_LOADING_MORE_GAP:window.innerHeight+c.SCROLL_LOADING_MORE_GAP>=a.getBoundingClientRect().bottom)&&(n.setState({isLoading:!0}),t().catch((function(e){console.error(e),(0,u.logError)(e)})).finally((function(){n.setState({isLoading:!1})}))))}),c.SCROLL_THROTTLE_DELAY),n.state={isLoading:!1},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e,t=this,n=this.props,r=n.stories,i=n.selectedStoriesMap,c=n.className,u=n.onToggleCheck,_=n.isEditingLinksAvailable,p=n.onStoryLinkUpdate,h=n.linkData,f=this.state.isLoading;return o.createElement("div",{className:(0,l.classNames)("NarrativeEditorAllTab ScrollContainer",c),ref:this.tabRef},o.createElement(a.StoryArchivePreviewGrid,{className:"NarrativeEditorAllTab__grid"},r.map((function(n){var r=!1,a=new Date(1e3*n.time).toDateString();return e&&a===e||(e=a,r=!0),o.createElement("div",{className:"NarrativeEditorAllTab__story",key:n.rawId},o.createElement(s.StoryArchivePreview,{story:n,checked:!!i[n.id],selectable:t.isSelectable(n),onToggleCheck:u,onStoryLinkUpdate:p,isEditingLinksAvailable:_,linkData:h,needShowDate:r}))}))),f&&o.createElement("div",{className:"NarrativeEditorAllTab__loader"},o.createElement(d.default,null)))},t.prototype.isSelectable=function(e){var t=this.props.selectedStoriesMap,n=Object.keys(t).length;return!e.isUnavailable&&!!(n<c.MAX_NARRATIVE_STORIES||t[e.id])},t.prototype.componentDidMount=function(){this.isMount=!0,this.initScrollListener()},t.prototype.componentWillUnmount=function(){this.isMount=!1,this.deInitScrollContainer()},t.prototype.initScrollListener=function(){var e=this.getScrollContainer(),t=this.getTabEl();e&&t&&e.addEventListener("scroll",this.onScroll,!0)},t.prototype.deInitScrollContainer=function(){var e;null===(e=this.getScrollContainer())||void 0===e||e.removeEventListener("scroll",this.onScroll)},t.prototype.getScrollContainer=function(){return this.props.appearance===i.EditorViewType.box?this.getTabEl():window},t.prototype.getTabEl=function(){var e;return null===(e=this.tabRef)||void 0===e?void 0:e.current},t.defaultProps={isEditingLinksAvailable:!1,hasMore:!1},t}(o.Component)},95893:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorCoverSection:()=>T});var r=n(70655),o=n(67294),i=n(87157),a=n(59397),s=n(80528),c=n(98529),l=n(41650),u=n(88420),d=n(18690),_=n(5101),p=n(4192),h=n(49535),f=n(74123),m=n(11143),g=n(94292),v=n(73023),y=n(54612),E=n(41926),w=n(61540),b=n(66433),C=n(33623),S=n(3562),T=function(e){function t(t){var n,i=e.call(this,t)||this;i.scrollContainerRef=o.createRef(),i.isMount=!1,i.isCropSubmitted=!1,i.onFilesLoad=function(e){i.file=e[0],i.file&&i.uploadCover()},i.uploadCover=function(){if(i.file){var e=i.file,t=i.props.coverUploadConfig,n=new v.UploadPhoto(t,i.onUploadCoverProgress);n.validate(e).then((function(){if(i.isMount){var t=URL.createObjectURL(e),o={id:S.CustomCoverId,url:t,customPhotoOriginalUrl:t,percent:0,status:S.CoverUploadStatus.uploading};return i.setState({customCover:o}),n.upload(e).then((function(e){if(i.isMount){var t=JSON.stringify(e);i.setState({customCover:(0,r.__assign)((0,r.__assign)({},o),{percent:100,status:S.CoverUploadStatus.uploaded,uploadResponse:t}),checkedCoverId:S.CustomCoverId})}}))}})).catch((function(e){if(i.isMount){var t=i.state.customCover;t&&(t=(0,r.__assign)((0,r.__assign)({},t),{percent:0,status:S.CoverUploadStatus.failed})),console.error(e),e=(0,a.isObject)(e)?e.text:String(e),(0,y.showFastBox)((0,l.getLang)("global_error"),e||(0,l.getLang)("global_unknown_error")),(0,b.logError)(new Error("error with uploadCover"+(e?": "+e:""))),i.setState({customCover:t})}}))}},i.onUploadCoverProgress=function(e,t){var n=Math.min(e/t*100,90);i.setState((function(e){var t=e.customCover;return t?{customCover:(0,r.__assign)((0,r.__assign)({},t),{percent:n})}:null}))},i.selectCustomCover=function(){i.setState({checkedCoverId:S.CustomCoverId})},i.toggleCheck=function(e){i.setState({checkedCoverId:e.rawId})},i.openCropper=function(){var e=i.state.checkedCoverId,t=i.getCoverById(e);if(t){var n=i.getCoverOriginalUrl(t);n&&(0,w.loadImage)(n).then((function(e){if(i.isMount){var o=e.width,a=e.height,s=(0,r.__read)(i.getThumbSizes(o,a),2),c=s[0],l=s[1];i.setState({isModalOpen:!0}),(0,E.showNarrativeCropCoverBox)({coverUrl:n,coverHeight:a,coverWidth:o,thumbHeight:l,thumbWidth:c,crop:t.crop,onSave:i.onCropSave,onClose:i.onCropClose})}})).catch((function(e){console.error(e),e=String(e),(0,y.showFastBox)((0,l.getLang)("global_error"),e||(0,l.getLang)("global_unknown_error")),(0,b.logError)(new Error("error with cover openCropper"+(e?": "+e:"")))}))}},i.onCropSave=function(e,t){return i.saveCustomPhotoIfNeeded().then((function(n){i.isCropSubmitted=!0;var o=i.state.covers;(0,S.isSelectableCustomCover)(n)?i.setState({customCover:(0,r.__assign)((0,r.__assign)({},n),{url:t,crop:e})}):i.setState({covers:o.map((function(o){return o.id===n.id?(0,r.__assign)((0,r.__assign)({},n),{url:t,crop:e}):o}))})}))},i.onCropClose=function(){var e=i.props.onSave,t=i.state.checkedCoverId;i.setState({isModalOpen:!1});var n=i.getCoverById(t);n&&i.isCropSubmitted&&e({url:n.url,coverStoryId:n.coverStoryId,customPhotoOriginalUrl:n.customPhotoOriginalUrl,customPhotoId:n.customPhotoId,crop:n.crop})},i.getFooterButtons=function(){var e=i.props.onSave,t=i.state.customCover;return[o.createElement(u.default,{key:"close",appearance:"tertiary",onClick:function(){return e()}},(0,l.getLang)("global_cancel")),o.createElement(d.default,{key:"save",onClick:i.openCropper,disabled:(null==t?void 0:t.status)===S.CoverUploadStatus.uploading},(0,l.getLang)("stories_narrative_cover_next_step"))]},i.onDragEnter=function(e){var t,n,r,o;("file"===(null===(n=null===(t=null==e?void 0:e.dataTransfer)||void 0===t?void 0:t.items[0])||void 0===n?void 0:n.kind)||(null===(o=null===(r=null==e?void 0:e.dataTransfer)||void 0===r?void 0:r.types)||void 0===o?void 0:o.includes("Files")))&&(clearTimeout(i.dragLeaveTimeout),delete i.dragLeaveTimeout,i.setState({showDropArea:!0})),(0,h.cancelEvent)(e)},i.onDragLeave=function(e){clearTimeout(i.dragLeaveTimeout),i.dragLeaveTimeout=setTimeout((function(){delete i.dragLeaveTimeout,i.setState({showDropArea:!1})}),100),(0,h.cancelEvent)(e)},i.onDragDrop=function(e){var t,n;i.onDragLeave(e),(null===(n=null===(t=null==e?void 0:e.dataTransfer)||void 0===t?void 0:t.files)||void 0===n?void 0:n.length)&&i.onFilesLoad(Array.from(e.dataTransfer.files));var r=i.getScrollContainer();r&&r.scrollTo({top:0,behavior:"smooth"}),(0,h.cancelEvent)(e)};var s=(0,r.__read)(i.buildCovers(t),2),c=s[0],_=s[1],p=null===(n=c[0])||void 0===n?void 0:n.id;if(t.cover){var f=t.cover.customPhotoId,m=t.cover.coverStoryId;p=f?S.CustomCoverId:m?t.storyMap[m].rawId:t.stories[0].rawId}return i.state={showDropArea:!1,covers:c,customCover:_,checkedCoverId:p,isModalOpen:!1},i}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.className,r=t.appearance,u=t.stories,d=this.state,h=d.customCover,v=d.checkedCoverId,y=d.showDropArea,E=d.isModalOpen;return o.createElement(_.NarrativeEditorSection,{className:(0,a.classNames)("NarrativeEditorCoverSection",n),appearance:r,actionFooterButtons:this.getFooterButtons()},o.createElement("div",{className:"ScrollContainer",ref:this.scrollContainerRef},o.createElement("div",{className:"NarrativeEditorCoverSection__hint StoryGridHint"},(0,l.getLang)("stories_choose_cover_hint")),o.createElement(s.StoryArchivePreviewGrid,{className:"NarrativeEditorCoverSection__grid"},o.createElement("div",{className:"NarrativeEditorCoverSection__create"},o.createElement(p.StoryLoadFile,{text:(0,l.getLang)("stories_upload_narrative_cover"),onFilesLoad:this.onFilesLoad})),h&&o.createElement(g.StoryCustomCoverPreview,{uploadingStatus:h.status,coverUrl:h.customPhotoOriginalUrl,checked:h.id===v,uploadingPercent:h.percent,onToggleCheck:this.selectCustomCover,retryUpload:this.uploadCover}),u.map((function(t){return o.createElement("div",{className:"NarrativeEditorCoverSection__story",key:t.rawId},o.createElement(c.StoryArchivePreview,{story:t,checked:v===t.rawId,selectable:!0,onToggleCheck:e.toggleCheck}))})))),y&&!E&&r===i.EditorViewType.box&&o.createElement(f.UploadDropBoxArea,null),y&&!E&&r===i.EditorViewType.page&&o.createElement(m.UploadDropPageArea,null))},t.prototype.getThumbSizes=function(e,t){var n,r,o=e/t;return e>=t?(n=Math.min(e,C.MAX_THUMB_WIDTH),(r=Math.floor(n/o))>C.MAX_THUMB_HEIGHT&&(r=C.MAX_THUMB_HEIGHT,n=Math.floor(r*o))):(r=Math.min(t,C.MAX_THUMB_HEIGHT),(n=Math.floor(r*o))>C.MAX_THUMB_WIDTH&&(n=C.MAX_THUMB_WIDTH,r=Math.floor(n/o))),[n,r]},t.prototype.saveCustomPhotoIfNeeded=function(){var e=this,t=this.props,n=t.ownerId,o=t.coverUploadConfig,i=this.state.checkedCoverId,a=this.getCoverById(i);return a?(0,S.needSavePhoto)(a)?new Promise((function(t,i){window.ajax.post("al_stories.php",{act:"save_narrative_cover",owner_id:n,upload_response:a.uploadResponse,hash:o.hash},{onDone:function(n){var o=e.state.customCover;if(e.isMount&&o){var a=(0,r.__assign)((0,r.__assign)({},o),{customPhotoId:n});t(a)}else i()},onFail:function(e){return console.error(e),i(e),!0}})})):Promise.resolve(a):Promise.reject()},t.prototype.componentDidMount=function(){this.isMount=!0;var e=this.getDragAndDropContainer();e&&(e.addEventListener("drop",this.onDragDrop),e.addEventListener("dragenter",this.onDragEnter),e.addEventListener("dragover",this.onDragEnter),e.addEventListener("dragleave",this.onDragLeave))},t.prototype.componentWillUnmount=function(){this.isMount=!1,null!=this.dragLeaveTimeout&&clearTimeout(this.dragLeaveTimeout);var e=this.getDragAndDropContainer();e&&(e.removeEventListener("drop",this.onDragDrop),e.removeEventListener("dragenter",this.onDragEnter),e.removeEventListener("dragover",this.onDragEnter),e.removeEventListener("dragleave",this.onDragLeave))},t.prototype.getDragAndDropContainer=function(){return this.props.appearance===i.EditorViewType.box?window.boxLayerWrap:document.body},t.prototype.getScrollContainer=function(){return this.props.appearance===i.EditorViewType.box?this.scrollContainerRef.current:document.documentElement},t.prototype.buildCovers=function(e){var t,n=e.cover,o=e.stories;return n&&(0,S.isCustomCover)(n)&&(t=(0,r.__assign)({id:S.CustomCoverId},n)),[o.map((function(e){return(null==n?void 0:n.coverStoryId)===e.id?(0,r.__assign)({id:e.rawId},n):{id:e.rawId,url:e.preview,coverStoryId:e.id}})),t]},t.prototype.getCoverById=function(e){return e===S.CustomCoverId?this.state.customCover:this.state.covers.find((function(t){return t.id===e}))},t.prototype.getCoverOriginalUrl=function(e){var t,n=this.props.storyMap,r="";return(0,S.isSelectableCustomCover)(e)?r=e.customPhotoOriginalUrl:e.coverStoryId&&(r=null===(t=n[e.coverStoryId])||void 0===t?void 0:t.originalPreviewUrl),r},t}(o.Component)},3562:(e,t,n)=>{"use strict";var r;function o(e){return Boolean(e.customPhotoId||e.uploadResponse)}function i(e){return Boolean(e.customPhotoId)}function a(e){return e.uploadResponse&&!e.customPhotoId}function s(e){var t={url:e.coverUrl,crop:e.coverCrop};return e.customCover?(t.customPhotoId=e.customCover.photoId,t.customPhotoOriginalUrl=e.customCover.originalPhotoUrl):t.coverStoryId=e.coverStoryId,t}n.d(t,{CoverUploadStatus:()=>r,isSelectableCustomCover:()=>o,isCustomCover:()=>i,needSavePhoto:()=>a,getPreparedCover:()=>s,CustomCoverId:()=>c}),function(e){e[e.uploaded=0]="uploaded",e[e.uploading=1]="uploading",e[e.failed=2]="failed"}(r||(r={}));var c="custom"},56252:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorDataPanel:()=>_});var r=n(70655),o=n(67294),i=n(41650),a=n(59397),s=n(49062),c=n(17173),l=n(49535),u=n(26271),d=n(62199),_=function(e){function t(t){var n=e.call(this,t)||this;return n.getInputEl=function(){return n.nameInputRef&&n.nameInputRef.current},n.onKeyDown=function(e){e.keyCode===l.KEY.ENTER&&(e.ctrlKey||e.metaKey&&u.browser.mac)&&n.props.onSubmit()},n.nameInputRef=o.createRef(),n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.name,n=e.onNameChange,r=e.selectedStoriesCount,l=e.coverUrl,u=e.onCoverClick,_=e.className,p=0===r,h="";return p||(h=(0,i.getLang)("stories_choose_cover")),o.createElement("div",{className:(0,a.classNames)("NarrativeEditorDataPanel",_)},o.createElement("div",{className:"NarrativeEditorDataPanel__preview"},o.createElement(s.NarrativeItemPreviewCover,{className:(0,a.classNames)("NarrativeEditorDataPanel__cover",{"NarrativeEditorDataPanel__cover--active":!p}),onClick:u,cover:l,title:h,extra:!p&&o.createElement("div",{className:"NarrativeEditorDataPanel__pencil"},o.createElement(d.default,null))}),o.createElement("span",{className:(0,a.classNames)("NarrativeEditorDataPanel__name",{"NarrativeEditorDataPanel__name--empty":!t})},t||(0,i.getLang)("stories_narrative_name_full"))),o.createElement("div",{className:"NarrativeEditorDataPanel__form"},o.createElement("span",{className:"NarrativeEditorDataPanel__nameLabel"},(0,i.getLang)("stories_narrative_name")),o.createElement("input",{className:"NarrativeEditorDataPanel__nameInput",value:t,onChange:n,onKeyDown:this.onKeyDown,type:"text",placeholder:(0,i.getLang)("stories_enter_name"),maxLength:c.NARRATIVE_MAX_TITLE_LENGTH,ref:this.nameInputRef,autoFocus:!0}),r>0&&o.createElement("span",{className:"NarrativeEditorDataPanel__selectedStoryCount"},(0,i.getLang)("stories_selected_count",r))))},t}(o.Component)},43188:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorFooter:()=>a});var r=n(67294),o=n(83295),i=n(50382),a=function(e){var t=e.appearance,n=e.actionButtons;return r.createElement("div",{className:(0,o.classNames)("NarrativeEditorFooter","NarrativeEditorFooter--"+t)},r.createElement(i.ModalFooter,{actionButtons:n}))}},5101:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorSection:()=>s});var r=n(70655),o=n(67294),i=n(43188),a=n(83295),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scrollContainerRef=o.createRef(),t}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.children,r=e.appearance,s=e.actionFooterButtons;return o.createElement("div",{className:(0,a.classNames)("NarrativeEditorSection",t),ref:this.scrollContainerRef},o.createElement("div",{className:"NarrativeEditorSection__body"},n),Boolean(s)&&o.createElement(i.NarrativeEditorFooter,{appearance:r,actionButtons:s}))},t.prototype.getSectionEl=function(){var e;return null===(e=this.scrollContainerRef)||void 0===e?void 0:e.current},t}(o.Component)},17139:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorSelectedTab:()=>_});var r=n(70655),o=n(67294),i=n(87157),a=n(80528),s=n(98529),c=n(83295),l=n(17173),u=n(87142),d="NarrativeEditorSelectedTab__storyPreview",_=function(e){function t(t){var n=e.call(this,t)||this;return n.gridContainerRef=o.createRef(),n.tabRef=o.createRef(),n.state={draggingStoryRawId:""},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.stories,r=t.selectedStoriesMap,i=t.className,l=t.isEditingLinksAvailable,u=t.onStoryLinkUpdate,_=t.linkData,p=t.onToggleCheck,h=this.state.draggingStoryRawId;return o.createElement("div",{className:(0,c.classNames)("NarrativeEditorSelectedTab ScrollContainer",i),ref:this.tabRef},o.createElement(a.StoryArchivePreviewGrid,{ref:this.gridContainerRef},n.map((function(t){return o.createElement("div",{className:"NarrativeEditorSelectedTab__story",key:t.rawId},o.createElement(s.StoryArchivePreview,{className:d,story:t,draggable:!0,isDragged:t.rawId===h,checked:!!r[t.id],selectable:e.isSelectable(t),onToggleCheck:p,onStoryLinkUpdate:u,isEditingLinksAvailable:l,linkData:_}))}))))},t.prototype.isSelectable=function(e){var t=this.props.selectedStoriesMap,n=Object.keys(t).length;return!e.isUnavailable&&!!(n<l.MAX_NARRATIVE_STORIES||t[e.rawId])},t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.onReorder,r=t.appearance,o=this.getGridContainer(),a={dragThreshold:0,onDragFinish:function(){e.setState({draggingStoryRawId:""})},onDragStart:function(t){var n=t.querySelector("."+d);if(n){var r=n.dataset.id;e.setState({draggingStoryRawId:r})}},onReorder:function(){var t=e.props.stories,r=document.querySelectorAll("."+d),o=[];r.forEach((function(e){var n=e.getAttribute("data-id"),r=t.find((function(e){return e.rawId===n}));r&&o.push(r.id)})),n(o)}};o&&(r===i.EditorViewType.box&&(a.wrapNode=this.getTabEl()),this.sorter=new u.default(o,"",a))},t.prototype.componentWillUnmount=function(){this.sorter&&this.sorter.destroy()},t.prototype.getTabEl=function(){var e;return null===(e=this.tabRef)||void 0===e?void 0:e.current},t.prototype.getGridContainer=function(){var e,t;return null===(t=null===(e=this.gridContainerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.getGridContainer()},t}(o.Component)},20516:(e,t,n)=>{"use strict";n.d(t,{NarrativeEditorStoriesTabPanel:()=>_});var r=n(70655),o=n(67294),i=n(87157),a=n(41650),s=n(41388),c=n(17139),l=n(88551),u=n(83295),d=n(17173),_=function(e){function t(t){var n=e.call(this,t)||this;return n.onTabClick=function(e,t){n.setState({tabKey:t,selectedTabStoryIds:(0,r.__spreadArray)([],(0,r.__read)(n.props.selectedStoryIds))})},n.onReorder=function(e){var t=n.props.onSelectedStoriesUpdate,r=n.getSelectedStoriesMap(),o=e.filter((function(e){return r[e]}));n.setState({selectedTabStoryIds:e}),t(o)},n.onStorySelectToggle=function(e){var t,o=n.props,a=o.selectedStoryIds,s=o.onSelectedStoriesUpdate,c=n.state,l=c.tabKey,u=c.selectedTabStoryIds,_=n.getSelectedStoriesMap();if(!(Object.keys(_).length>=d.MAX_NARRATIVE_STORIES)||_[e.id]){if(!u.length)return n.setState({selectedTabStoryIds:[e.id]}),void s([e.id]);if(_[e.id]){s(a.filter((function(t){return t!==e.id})))}else{var p=[],h=(0,r.__assign)((0,r.__assign)({},_),((t={})[e.id]=e,t));if(l===i.EditorTabKey.selected)p=u.filter((function(e){return h[e]}));else if(l===i.EditorTabKey.all){if(u.includes(e.id))p=u.filter((function(e){return h[e]}));else p=(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(u)),[e.id]).filter((function(e){return h[e]})),n.setState({selectedTabStoryIds:(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(u)),[e.id])})}s(p)}}},n.state={tabKey:t.selectedStoryIds.length?i.EditorTabKey.selected:i.EditorTabKey.all,selectedTabStoryIds:(0,r.__spreadArray)([],(0,r.__read)(t.selectedStoryIds))},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.selectedStoryIds,r=t.appearance,d=t.isEditingLinksAvailable,_=t.linkData,p=t.onStoryLinkUpdate,h=t.loadMore,f=t.hasMore,m=this.state.tabKey,g=this.getSelectedStoriesMap(),v=this.getAllStories();return o.createElement("div",{className:"NarrativeEditorStoriesTabPanel"},o.createElement(s.default,{className:"NarrativeEditorStoriesTabPanel__tabs",onTabClick:this.onTabClick,active:m,disabledTabMap:(e={},e[i.EditorTabKey.selected]=!n.length,e)},o.createElement("span",{key:i.EditorTabKey.selected},(0,a.getLang)("stories_narrative_editor_selected_tab"),n.length>0&&o.createElement("span",{className:"Tabs__desc"},n.length)),o.createElement("span",{key:i.EditorTabKey.all},(0,a.getLang)("stories_narrative_editor_all_tab"))),m===i.EditorTabKey.selected&&o.createElement(c.NarrativeEditorSelectedTab,{className:(0,u.classNames)("NarrativeEditorSelectPanel__grid","NarrativeEditorSelectPanel__grid--"+r),appearance:r,stories:this.getSelectedTabStories(),onReorder:this.onReorder,onToggleCheck:this.onStorySelectToggle,selectedStoriesMap:g,onStoryLinkUpdate:p,isEditingLinksAvailable:d,linkData:_}),m===i.EditorTabKey.all&&o.createElement(l.NarrativeEditorAllTab,{className:(0,u.classNames)("NarrativeEditorSelectPanel__grid","NarrativeEditorSelectPanel__grid--"+r),appearance:r,stories:v,loadMore:h,hasMore:f,onToggleCheck:this.onStorySelectToggle,selectedStoriesMap:g,onStoryLinkUpdate:p,isEditingLinksAvailable:d,linkData:_}))},t.prototype.getSelectedTabStories=function(){var e=this;return this.state.selectedTabStoryIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.getAllStories=function(){var e=this;return this.props.storyIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.getSelectedStoriesMap=function(){var e=this;return this.props.selectedStoryIds.reduce((function(t,n){return t[n]=e.props.storyMap[n],t}),{})},t.defaultProps={isEditingLinksAvailable:!1},t}(o.Component)},49062:(e,t,n)=>{"use strict";n.d(t,{NarrativeItemPreviewCover:()=>i});var r=n(67294),o=n(83295),i=r.memo((function(e){var t=e.title,n=e.onClick,i=e.cover,a=e.href,s=e.className,c=void 0===s?"":s,l=e.extra,u=e.noBorder,d=void 0!==u&&u,_=e.isDraft,p=void 0!==_&&_,h=e.size,f=void 0===h?58:h,m=i?{backgroundImage:"url("+i+")"}:{},g=(0,o.classNames)("NarrativeItemPreviewCover","NarrativeItemPreviewCover--size"+f,c,{"NarrativeItemPreviewCover--noBorder":d,"NarrativeItemPreviewCover--isDraft":p}),v=r.createElement("div",{className:"NarrativeItemPreviewCover__image",style:m,title:t||void 0},l);return r.createElement(r.Fragment,null,a&&r.createElement("a",{href:a,className:g,onClick:n},v),!a&&r.createElement("div",{className:g,onClick:n},v))}))},9542:(e,t,n)=>{"use strict";n.d(t,{NarrativeRow:()=>l});var r=n(67294),o=n(49062),i=n(67625),a=n(59397),s=n(41650),c=n(21114),l=r.memo((function(e){var t,n,l,u,d=e.narrative,_=e.aside,p=e.onClick,h=e.className,f=e.clickable,m=e.size,g=e.noBorder,v=!d.storiesCount,y=v?"":"/narrative"+d.ownerId+"_"+d.id;return v?(t=r.createElement(o.NarrativeItemPreviewCover,{isDraft:!0,extra:r.createElement(c.default,null),size:m}),n=r.createElement(r.Fragment,null,(0,s.getLang)("groups_narrative_box_stories_count",d.storiesCount),r.createElement("span",{className:"dvd"}),r.createElement("span",null,(0,s.getLang)("stories_narratives_draft")))):(t=r.createElement(o.NarrativeItemPreviewCover,{onClick:p,size:m,cover:d.coverUrl,href:y,noBorder:g}),n=r.createElement("span",null,(0,s.getLang)("groups_narrative_box_stories_count",d.storiesCount))),f?l=p:v||(u=p),r.createElement("div",{className:(0,a.classNames)("NarrativeRow NarrativeListItem",h,{"NarrativeRow--clickable":f}),"data-id":d.id,onClick:l},r.createElement(i.NarrativeRowBase,{className:"NarrativeRow__inner",href:y,onClick:u,preview:t,id:d.id,title:d.title,subtitle:n,size:m,aside:_}))}))},67625:(e,t,n)=>{"use strict";n.d(t,{NarrativeRowBase:()=>s});var r=n(70655),o=n(67294),i=n(49849),a=n(59397),s=o.memo((function(e){e.id;var t,n=e.title,s=e.subtitle,c=e.preview,l=e.aside,u=e.href,d=e.onClick,_=e.className,p=void 0===_?"":_,h=e.size,f=void 0===h?58:h,m=(0,r.__rest)(e,["id","title","subtitle","preview","aside","href","onClick","className","size"]),g=Boolean(d||u);return n=(0,i.decodeHTMLEntities)(n),t=u?o.createElement("a",{href:u,className:"NarrativeRowBase__title",onClick:d},n):o.createElement("span",{className:"NarrativeRowBase__title",onClick:d},n),o.createElement("div",(0,r.__assign)({className:(0,a.classNames)("NarrativeRowBase","NarrativeRowBase--previewSize"+f,p,{"NarrativeRowBase--clickable":g})},m),o.createElement("div",{className:"NarrativeRowBase__preview"},c),o.createElement("div",{className:"NarrativeRowBase__inner"},o.createElement("div",{className:"NarrativeRowBase__main"},o.createElement("div",{className:"NarrativeRowBase__title"},t),s&&o.createElement("div",{className:"NarrativeRowBase__subtitle"},s)),l&&o.createElement("div",{className:"NarrativeRowBase__aside"},l)))}))},85597:(e,t,n)=>{"use strict";n.d(t,{NarrativeRowCreation:()=>l});var r=n(70655),o=n(67294),i=n(67625),a=n(41650),s=n(59397),c=n(87083),l=o.memo((function(e){var t=e.onClick,n=e.clickable,l=void 0!==n&&n,u=e.size,d=void 0===u?58:u,_=(0,a.getLang)("stories_create_new_narrative"),p=o.createElement("div",{className:(0,s.classNames)("NarrativeRowCreation__preview","NarrativeRowCreation__preview--size"+d)},o.createElement(c.default,null));return o.createElement("div",(0,r.__assign)({className:(0,s.classNames)("NarrativeRowCreation NarrativeListItem",{"NarrativeRowCreation--clickable":l})},{nodrag:"true"}),o.createElement(i.NarrativeRowBase,{className:"NarrativeRowCreation__inner",title:_,onClick:t,preview:p,size:d}))}))},51907:(e,t,n)=>{"use strict";n.d(t,{NarrativeSnippet:()=>a});var r=n(67294),o=n(41650),i=n(59397),a=function(e){var t=e.className,n=e.coverUrl,a=e.title,s=e.ownerName,c=e.storyCount;return r.createElement("div",{className:(0,i.classNames)("NarrativeSnippet",t)},r.createElement("div",{className:"NarrativeSnippet__inner"},r.createElement("div",{className:"NarrativeSnippet__cover"},r.createElement("div",{className:"NarrativeSnippet__image",style:{backgroundImage:"url("+n+")"}})),r.createElement("div",{className:"NarrativeSnippet__info"},r.createElement("div",{className:(0,i.classNames)("NarrativeSnippet__title",{"NarrativeSnippet__title--empty":!a})},a||(0,o.getLang)("stories_narrative_name_full")),r.createElement("span",{className:"NarrativeSnippet__author"},s),r.createElement("span",{className:"NarrativeSnippet__description"},r.createElement("span",null,(0,o.getLang)("global_type_narrative")),r.createElement("span",{className:"dvd"}),r.createElement("span",null,(0,o.getLang)("global_narrative_stories_count",c))))))}},98529:(e,t,n)=>{"use strict";n.d(t,{StoryArchivePreview:()=>p});var r=n(70655),o=n(67294),i=n(83295),a=n(41650),s=n(41926),c=n(66433),l=n(89988),u=n(13984),d=n(4022),_=n(39664),p=function(e){function t(t){var n=e.call(this,t)||this;return n.videoRef=o.createRef(),n.needPauseAfterLoading=!1,n.onLinkButtonClick=function(e){var t=n.props,r=t.story,o=t.onStoryLinkUpdate,i=t.linkData;t.isDragged||((0,s.showStoryLinkEditorBox)({story:r,onStoryLinkUpdate:o,linkData:i}),e.stopPropagation())},n.onMouseEnter=function(){n.setState({isHovered:!0})},n.onMouseLeave=function(){n.setState({isHovered:!1})},n.onToggleCheck=function(){var e=n.props,t=e.onToggleCheck,r=e.story;!e.isDragged&&t&&t(r)},n.state={isHovered:!1,preloadVideo:!1,canPlayVideo:!1,isLoading:!1},n}return(0,r.__extends)(t,e),t.prototype.componentDidUpdate=function(e,t){var n=this.props,r=n.story,o=n.isDragged,i=this.state.isHovered;r.videoUrl&&(o||(!t.isHovered&&i?this.playVideo():t.isHovered&&!i&&this.pauseVideo()),!e.isDragged&&o&&this.pauseVideo(),e.isDragged&&!o&&i&&this.playVideo())},t.prototype.componentWillUnmount=function(){this.cleanVideoPlayTimeout(),this.cleanVideoPauseTimeout(),this.cleanVideoLoaderTimeout()},t.prototype.playVideo=function(e){var t=this;void 0===e&&(e=!1),null!=this.videoPauseDelayTimeout&&this.cleanVideoPauseTimeout();var n=function(){delete t.videoPlayDelayTimeout,t.videoRef.current&&(t.videoRef.current.muted=!0,t.videoRef.current.play().then((function(){var e;if(t.hideLoader(),t.setState({canPlayVideo:!0}),t.needPauseAfterLoading)return null===(e=t.videoRef.current)||void 0===e||e.pause(),void(t.needPauseAfterLoading=!1)})).catch((function(e){t.hideLoader(),console.error(e),(0,c.logError)(e)})))};e?n():null==this.videoPlayDelayTimeout&&(this.videoLoaderTimeout=setTimeout((function(){t.setState({isLoading:!0})}),800),this.setState({preloadVideo:!0}),this.videoPlayDelayTimeout=setTimeout((function(){n()}),200))},t.prototype.pauseVideo=function(e){var t=this;void 0===e&&(e=!1),null!=this.videoPlayDelayTimeout&&this.cleanVideoPlayTimeout();var n=function(){var e;if(delete t.videoPauseDelayTimeout,t.hideLoader(),t.state.canPlayVideo){var n=null===(e=t.videoRef)||void 0===e?void 0:e.current;null==n||n.pause()}else t.needPauseAfterLoading=!0};e?n():null==this.videoPauseDelayTimeout&&(this.videoPauseDelayTimeout=setTimeout((function(){n()}),200))},t.prototype.cleanVideoPlayTimeout=function(){this.videoPlayDelayTimeout&&(clearTimeout(this.videoPlayDelayTimeout),delete this.videoPlayDelayTimeout)},t.prototype.cleanVideoPauseTimeout=function(){this.videoPauseDelayTimeout&&(clearTimeout(this.videoPauseDelayTimeout),delete this.videoPauseDelayTimeout)},t.prototype.cleanVideoLoaderTimeout=function(){this.videoLoaderTimeout&&(clearTimeout(this.videoLoaderTimeout),delete this.videoLoaderTimeout)},t.prototype.hideLoader=function(){this.state.isLoading&&this.setState({isLoading:!1}),this.cleanVideoLoaderTimeout()},t.prototype.render=function(){var e=this,t=this.props,n=t.story,r=t.checked,s=t.selectable,c=t.draggable,p=t.className,h=t.isEditingLinksAvailable,f=t.needShowDate,m=this.state,g=m.preloadVideo,v=m.canPlayVideo,y=m.isLoading,E=Boolean(n.videoUrl),w=new Date(1e3*n.time);return o.createElement("div",{className:(0,i.classNames)("StoryArchivePreview","StoryPreviewContainer",p,{"StoryArchivePreview--video":E,"StoryArchivePreview--checked":r}),onClick:this.onToggleCheck,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,"data-id":n.rawId},o.createElement("div",{className:"StoryArchivePreview__wrapper"},E&&o.createElement(o.Fragment,null,g&&o.createElement("video",{className:(0,i.classNames)("StoryArchivePreview__media",{"StoryArchivePreview__media--hidden":!v}),src:n.videoUrl,ref:this.videoRef,controls:!1,preload:"metadata",loop:!0,playsInline:!0}),!v&&o.createElement("img",{className:"StoryArchivePreview__media",src:n.preview,alt:""})),!E&&o.createElement("img",{className:"StoryArchivePreview__media",src:n.preview,alt:""}),f&&o.createElement("div",{className:"StoryArchivePreview__date"},o.createElement("div",{className:"StoryArchivePreview__day"},w.getDate()),o.createElement("div",{className:"StoryArchivePreview__month"},o.createElement(u.default,null,(0,a.getLang)("months_sm_of")[w.getMonth()+1]))),c&&!f&&o.createElement("div",{className:"StoryArchivePreview__draggableIcon"}),s&&o.createElement("div",{className:(0,i.classNames)("StoryArchivePreview__select",{"StoryArchivePreview__select--on":r})}),(h||n.videoUrl)&&o.createElement("div",{className:"StoryArchivePreview__footer"},o.createElement("div",{className:"StoryArchivePreview__footerInner"},n.videoUrl&&o.createElement("div",{className:"StoryArchivePreview__play"},o.createElement(d.default,null),o.createElement("span",{className:"StoryArchivePreview__playTime"},(0,l.formatTime)(n.duration))),h&&o.createElement("div",{className:"StoryArchivePreview__linkBtn",onClick:function(t){return e.onLinkButtonClick(t)}},n.linkUrl?(0,a.getLang)("stories_edit_link"):(0,a.getLang)("stories_add_link")))),y&&o.createElement("div",{className:"StoryArchivePreview__loader"},o.createElement(_.default,{size:24,strokeWidth:3,color:"#fff"}))))},t.defaultProps={checked:!1,selectable:!1,draggable:!1,isDragged:!1,className:"",isEditingLinksAvailable:!1,onToggleCheck:function(){},onStoryLinkUpdate:function(){},linkData:[]},t}(o.PureComponent)},80528:(e,t,n)=>{"use strict";n.d(t,{StoryArchivePreviewGrid:()=>a});var r=n(70655),o=n(67294),i=n(83295),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gridContainerRef=o.createRef(),t}return(0,r.__extends)(t,e),t.prototype.getGridContainer=function(){return this.gridContainerRef.current},t.prototype.render=function(){var e=this.props,t=e.className,n=e.children,r=e.isScrolling;return o.createElement("div",{className:(0,i.classNames)("StoryArchivePreviewGrid",t,{"StoryArchivePreviewGrid--scrolling":r})},o.createElement("div",{className:"StoryArchivePreviewGrid__inner",ref:this.gridContainerRef},n))},t.defaultProps={className:""},t}(o.Component)},94292:(e,t,n)=>{"use strict";n.d(t,{StoryCustomCoverPreview:()=>u});var r=n(70655),o=n(67294),i=n(59397),a=n(86427),s=n(10902),c=n(41650),l=n(3562),u=function(e){function t(t){return e.call(this,t)||this}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.checked,n=e.coverUrl,r=e.onToggleCheck,u=e.uploadingStatus,d=e.uploadingPercent,_=e.retryUpload,p=u===l.CoverUploadStatus.uploaded,h=u===l.CoverUploadStatus.uploading,f=u===l.CoverUploadStatus.failed,m=p;return o.createElement("div",{className:(0,i.classNames)("StoryCustomCoverPreview StoryPreviewContainer",{"StoryCustomCoverPreview--empty":h||f}),onClick:function(){m&&r()}},p&&o.createElement("div",{className:"StoryCustomCoverPreview__coverFrame"},o.createElement("div",{className:"StoryCustomCoverPreview__coverWrap"},o.createElement("img",{src:n,className:"StoryCustomCoverPreview__cover",alt:""}))),h&&o.createElement(a.StoryProgressSpinner,{percent:d}),f&&o.createElement(o.Fragment,null,o.createElement(s.default,null),o.createElement("span",{className:"StoryCustomCoverPreview__errorText"},(0,c.getLang)("stories_upload_error_text")),o.createElement("div",{className:"StoryCustomCoverPreview__repeat",onClick:_},(0,c.getLang)("stories_upload_repeat"))),m&&o.createElement("div",{className:(0,i.classNames)("StoryCustomCoverPreview__select",{"StoryCustomCoverPreview__select--on":t})}))},t.defaultProps={uploadingStatus:l.CoverUploadStatus.uploaded},t}(o.PureComponent)},30095:(e,t,n)=>{"use strict";n.d(t,{StoryLinkEditorBox:()=>v});var r=n(70655),o=n(67294),i=n(41650),a=n(88420),s=n(41929),c=n(94538),l=n(56589),u=n(70078),d=n(95724),_=n(54612),p=n(86409),h=n(66433),f=n(18690),m=n(86125),g=n(61540),v=function(e){function t(t){var n=e.call(this,t)||this;return n.inputRef=o.createRef(),n.needCleanLink=!1,n.onChangeLink=function(e){var t=(0,d.trim)(e.target.value);n.needCleanLink&&(n.needCleanLink=!1,t=n.cleanLink(t)||t),n.setState({link:t,needShowHint:!n.isLinkValid(t)})},n.onKeyUpLink=function(){var e=n.state.link;n.setState({needShowHint:!n.isLinkValid(e)})},n.onPasteLink=function(){n.needCleanLink=!0},n.onChangeLinkType=function(e){n.setState({linkType:String(e.selected.value)})},n.onSave=function(){var e,t,r,o,a=n.props.linkData,s=n.state.linkType,c=n.state.link;if(c=(0,d.trim)(c),!n.isLinkValid(c))return null===(t=null===(e=n.inputRef)||void 0===e?void 0:e.current)||void 0===t||t.focus(),null===(o=null===(r=n.inputRef)||void 0===r?void 0:r.current)||void 0===o||o.notaBene(),void n.setState({needShowHint:!0});var l=c?"https://"+(0,g.getHostName)()+"/"+c:"";a.needShowHint?(0,_.showFastBox)((0,i.getLang)("stories_saving_link"),(0,i.getLang)("stories_link_editing_warning"),(0,i.getLang)("global_save"),(function(e){n.edit(l,s,!0,e)}),(0,i.getLang)("global_cancel")):n.edit(l,s)},n.onDelete=function(){n.props.linkData.needShowHint?(0,_.showFastBox)((0,i.getLang)("stories_deleting_link"),(0,i.getLang)("stories_link_deleting_warning"),(0,i.getLang)("global_delete"),(function(e){n.delete(e)}),(0,i.getLang)("global_cancel")):n.delete()},n.state={link:t.story.linkUrl?n.cleanLink(t.story.linkUrl):"",linkType:t.story.linkType||t.linkData.items[0].value,needShowHint:!1,isSaving:!1,isDeleting:!1},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,n=e.linkData,r=this.state,a=r.linkType,d=r.link,_=r.needShowHint,p=this.isEditMode()?(0,i.getLang)("stories_edit_link_title"):(0,i.getLang)("stories_add_link_title");return o.createElement(s.BoxModal,{className:"StoryLinkEditorBox",appearance:"blue",onClose:t,title:p,actionButtons:this.getActionButtons(),hasScroll:!1},o.createElement("div",{className:"StoryLinkEditorBox__inner"},o.createElement("div",{className:"StoryLinkEditorBox__row"},o.createElement("span",{className:"StoryLinkEditorBox__label"},(0,i.getLang)("stories_link_label_url")),o.createElement("div",{className:"StoryLinkEditorBox__control"},o.createElement(u.StoryLinkHint,{open:_,text:(0,i.getLang)("stories_upload_link_format")},o.createElement("div",{className:"StoryLinkHint__input"},o.createElement(c.InputWithPrefix,{className:"StoryLinkEditorBox__input",prefix:"https://"+(0,g.getHostName)()+"/",value:d,onChange:this.onChangeLink,onKeyUp:this.onKeyUpLink,onPaste:this.onPasteLink,autoFocus:!0,ref:this.inputRef}))))),o.createElement("div",{className:"StoryLinkEditorBox__row"},o.createElement("span",{className:"StoryLinkEditorBox__label"},(0,i.getLang)("stories_link_label_text")),o.createElement("div",{className:"StoryLinkEditorBox__control"},o.createElement(l.default,{className:"StoryLinkEditorBox__select",appearance:"secondary",options:n.items,value:a,onChange:this.onChangeLinkType})))))},t.prototype.isEditMode=function(){return Boolean(this.props.story.linkUrl)},t.prototype.isLinkValid=function(e){return Boolean(e)&&e.length>=2&&Boolean(e.match(/^[a-z0-9\/\-._%=?&@#]+$/i))&&!decodeURIComponent(e).match(/away.php/)},t.prototype.cleanLink=function(e){var t=(e=(0,d.trim)(e)).match(/[https?:\/\/]*((?:[a-z0-9_\-]+\.)+(?:[a-z]{2,9})\/)(.*?)?(\#.*?)?(?:[\.!:;,\*\(\)&]*&nbsp;|[ \t\r\n \u00A0]|$)/i);return(t&&t[2]?t[2]:"")+(t&&t[3]?t[3]:"")},t.prototype.edit=function(e,t,n,r){var o=this;void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=!0);var a=this.props,s=a.onStoryLinkUpdate,c=a.onClose,l=a.story,u=a.linkData;window.ajax.post("al_stories.php",{act:"edit_link",story_raw_id:l.rawId,link_url:e,link_text:t,hash:u.editHash},{onDone:function(){c(),s(l.rawId,e,t)},onFail:function(e){(0,m.showDoneBox)(e||(0,i.getLang)("global_unknown_error"));var t="Link saving error in StoryLinkEditor"+(e?": "+e:"");return(0,h.logError)(new Error(t)),!0},showProgress:function(){n?o.setState({isSaving:!0}):o.setState({isDeleting:!0}),(0,p.lockButton)(r)},hideProgress:function(){var e;r&&(null===(e=(0,m.curBox)())||void 0===e||e.hide(),(0,p.unlockButton)(r)),n?o.setState({isSaving:!1}):o.setState({isDeleting:!1})}})},t.prototype.delete=function(e){this.edit("","",!1,e)},t.prototype.getActionButtons=function(){var e=this.props.onClose,t=this.state,n=t.isSaving,r=t.isDeleting,s=[o.createElement(a.default,{key:"close",appearance:"tertiary",onClick:function(){return e()}},(0,i.getLang)("global_cancel")),o.createElement(f.default,{loading:n,key:"save",appearance:"primary",onClick:this.onSave},this.isEditMode()?(0,i.getLang)("global_save"):(0,i.getLang)("stories_add_link"))];return this.isEditMode()&&s.unshift(o.createElement(f.default,{loading:r,appearance:"link",key:"delete",className:"StoryLinkEditorBox__extraFooterBtn",onClick:this.onDelete},(0,i.getLang)("stories_delete_link"))),s},t}(o.Component)},70078:(e,t,n)=>{"use strict";n.d(t,{StoryLinkHint:()=>i});var r=n(67294),o=n(14217),i=function(e){var t=e.text,n=e.children,i=e.open,a=void 0!==i&&i,s=r.createElement("div",{className:"StoryLinkHint"},r.createElement("div",{className:"StoryLinkHint__inner"},t));return r.createElement(o.Popper,{open:a,position:"t",align:"left",content:s},n)}},4192:(e,t,n)=>{"use strict";n.d(t,{StoryLoadFile:()=>i});var r=n(67294),o=n(88124),i=function(e){var t=e.text,n=e.multiple,i=void 0!==n&&n,a=e.onFilesLoad;return r.createElement("div",{className:"StoryLoadFile StoryPreviewContainer"},r.createElement(o.default,null),r.createElement("span",{className:"StoryLoadFile__text"},t),r.createElement("input",{type:"file",className:"StoryLoadFile__input",multiple:i,onChange:function(e){var t=e.currentTarget.files;t&&a(Array.from(t))}}))}},86427:(e,t,n)=>{"use strict";n.d(t,{StoryProgressSpinner:()=>a});var r=n(67294),o=3,i=2*Math.PI*22,a=r.memo((function(e){var t=e.percent,n=void 0===t?60:t,a=e.width,s=void 0===a?24:a,c=e.height,l=void 0===c?24:c,u=(i-o)*n/100+o;return r.createElement("svg",{className:"StoryProgressSpinner",width:s,height:l,viewBox:"0 0 50 50"},r.createElement("circle",{cx:"25",cy:"25",r:22,stroke:"#fff",fill:"none",strokeWidth:"6",strokeMiterlimit:"10",strokeDashoffset:"0",strokeDasharray:u+","+i,strokeLinecap:"round"}))}))},74123:(e,t,n)=>{"use strict";n.d(t,{UploadDropBoxArea:()=>i});var r=n(67294),o=n(41650),i=function(){return r.createElement("div",{className:"UploadDropBoxArea"},r.createElement("div",{className:"UploadDropBoxArea__inner"},r.createElement("div",{className:"UploadDropBoxArea__text"},(0,o.getLang)("stories_narrative_cover_drop_hint"))))}},11143:(e,t,n)=>{"use strict";n.d(t,{UploadDropPageArea:()=>a});var r=n(67294),o=n(41650),i=n(94021),a=function(){return r.createElement(i.WithPortal,null,r.createElement("div",{className:"UploadDropPageArea"},r.createElement("div",{className:"UploadDropPageArea__inner"},r.createElement("div",{className:"UploadDropPageArea__image"}),r.createElement("div",{className:"UploadDropPageArea__text"},(0,o.getLang)("stories_drop_page_area_label")))))}},17173:(e,t,n)=>{"use strict";n.d(t,{MAX_NARRATIVE_STORIES:()=>r,NARRATIVE_MAX_TITLE_LENGTH:()=>o,BOX_ITEM_DRAGGABLE_CLASS:()=>i,SCROLL_THROTTLE_DELAY:()=>a,SCROLL_LOADING_MORE_GAP:()=>s});var r=100,o=23,i="NarrativeBox__draggable",a=34,s=400},52745:(e,t,n)=>{"use strict";n.d(t,{prepareStoriesForPublishing:()=>p,updateNarrativeBlock:()=>h,highlightNarrativeBlock:()=>f,updateNarrativeSnippetsFromQueueByPost:()=>m});var r=n(15544),o=n(86125),i=n(60717),a=n(86067),s=n(40906),c=n(14200),l=n(56901),u=n(33228),d=n(66433),_=n(19331);function p(e){return e.map((function(e){return e.id})).join(",")}function h(e){void 0===e&&(e=!1);var t=(0,s.intval)(window.cur.oid);if(window.cur.narrativeBlock)window.ajax.post("al_stories.php",{act:"get_narrative_block",owner_id:t},{onDone:function(e){var t=(0,s.intval)(window.cur.oid),n=document.getElementById("narratives_module"+t+"_wrapper");if(n)if(e)(0,r.domReplaceEl)(n,e),window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),window.NarrativeBlock&&(window.cur.narrativeBlock=new c.default);else{var o=n.parentElement;(null==o?void 0:o.children.length)&&(null==o?void 0:o.children.length)>1?n.remove():null==o||o.remove(),window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),delete window.cur.narrativeBlock}(0,u.removeStoryList)("narratives"+t)}});else if(t>0&&"profile"===window.cur.module){var n=document.getElementById(l.PROFILE_MEDIA_NARROW_BLOCK_ID),i=!n;window.ajax.post("al_stories.php",{act:"get_narrative_block",owner_id:t,need_wrap_block:(0,s.intval)(i)},{onDone:function(e){if(n)n.insertAdjacentHTML("afterbegin",e);else{var r=document.getElementById("narrow_column");if(!r)return;r.insertAdjacentHTML("beforeend",e)}window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),window.NarrativeBlock&&(window.cur.narrativeBlock=new c.default,window.cur.narrativeBlock.showOnboardTooltipIfNeeded()),(0,u.removeStoryList)("narratives"+t)}})}else e&&function(e){window.boxQueue.hideAll();var t=document.querySelector("#box_layer_wrap"),n=document.querySelector("#box_loader");window.nav.reload({onDone:function(){e&&e()},showProgress:function(){(0,r.show)(t),(0,r.show)(n),(0,o.boxRefreshCoords)(n)},hideProgress:function(){(0,r.hide)(t),(0,r.hide)(n)}})}((function(){window.cur.needNarrativeOnboard=!0}))}function f(e){if(e){var t="narratives_module"+window.vk.id;(0,i.highlightModule)({module:t,text:(0,a.getLang)("stories_narrative_block_onboarding_text"),onClose:function(){delete window.cur.needNarrativeOnboard,window.ajax.post("al_index.php",{act:"hide_feature_tt",hash:e,type:"profile_narrative"})},autoCancelDelay:1e4,speed:600})}}function m(e){if(window.vk.id&&(0,_.partConfigEnabled)("update_private_snippets_by_queue")){var t=Array.from(e.querySelectorAll(".NarrativeSnippet"));if(t.length){var n=[];t.forEach((function(e){if(window.vk.id&&e.dataset.needUpdate){var t=e.dataset.narrativeRawId;t&&n.push({narrative_raw_id:t,snippet_type:e.dataset.snippetType,from:e.dataset.from})}})),n.length&&window.ajax.post("al_stories.php",{act:"get_narrative_snippets",narrative_snippets:JSON.stringify(n)},{onDone:function(e){t.forEach((function(t){t.dataset.narrativeRawId&&e[t.dataset.narrativeRawId]&&(t.outerHTML=e[t.dataset.narrativeRawId])}))},onFail:function(){return(0,d.logError)(new Error("Fail: updateNarrativeSnippetFromQueueByPost")),!0}})}}}},41926:(e,t,n)=>{"use strict";n.d(t,{showNarrativeEditorBox:()=>w,showNarrativeBox:()=>b,showStoryLinkEditorBox:()=>C,showNarrativeCropCoverBox:()=>S});var r=n(70655),o=n(67294),i=n(87157),a=n(49849),s=n(81117),c=n(15985),l=n(9652),u=n(86125),d=n(86067),_=n(86409),p=n(54612),h=(n(44451),n(84215),n(30095)),f=n(66433),m=n(11898),g=n(49464),v=n(33623),y=n(3562),E=560;function w(e,t){void 0===t&&(t={});var n={},c=t.narrative,l=t.onClose,_=t.onSave,p=t.navScreen,h=t.stories,g=t.selectedStories,v=void 0===g?[]:g,E=t.publishHash,w=t.editHash,b=t.linkData,C=t.isEditingLinksAvailable,S=t.storiesCount,T=t.coverUploadConfig,D=t.getPublishDoneHTML,P=!1;function A(){window.stManager.add(["NarrativeEditor.css"]).then((function(){n.box=(0,s.showComponentInBox)(M(),{width:638,onDestroy:function(e){(0,s.destroyComponentInBox)(e),l&&l(P)}})})).catch((function(e){console.error(e),(0,f.logError)(e)}))}function k(){return(null==h?void 0:h.length)?new Promise((function(t,n){if(!(null==h?void 0:h.length))return n("empty stories");window.ajax.post("al_stories.php",{act:"get_archive_stories",owner_id:e,offset:h.length},{onDone:function(e,o){if(h){h=(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(h)),(0,r.__read)(e));var i=(S=o)>h.length;t(i),x()}else n("empty stories after loading")},onFail:function(e){return n(e),!0}})})):Promise.reject("empty stories")}function I(e){P=!0,_&&_(e)}function O(e){n.box&&n.box.hide(),e&&e()}function x(){(null==h?void 0:h.length)&&E&&w&&(0,s.updateCurrentComponentInBox)(M())}function R(e,t,n){if(null==h?void 0:h.length){var o=function(o){return null==o?void 0:o.map((function(o){return o.rawId===e?(0,r.__assign)((0,r.__assign)({},o),{linkUrl:t,linkType:n}):o}))};h=o(h),v=o(v)||[],x()}}function M(){if((null==h?void 0:h.length)&&E&&w&&S&&T){var t=h.reduce((function(e,t){return e[t.id]=t,e}),{});t=v.reduce((function(e,t){return e[t.id]=t,e}),t);var n=h.map((function(e){return e.id})),r=v.map((function(e){return e.id})),s=c?i.EditorModeType.edit:i.EditorModeType.create,l=(null==c?void 0:c.title)?(0,a.decodeHTMLEntities)(c.title):"",u=S>h.length,d=c?(0,y.getPreparedCover)(c):void 0;return o.createElement(m.NarrativeEditor,{ownerId:e,type:s,name:l,narrativeRawId:null==c?void 0:c.rawId,cover:d,selectedStoryIds:r,storyIds:n,hasMore:u,storyMap:t,close:O,loadMore:k,onSave:I,publishHash:E,editHash:w,linkData:b,isEditingLinksAvailable:C,onStoryLinkUpdate:R,appearance:i.EditorViewType.box,navScreen:p,coverUploadConfig:T,getPublishDoneHTML:D})}}h&&E&&w&&S&&T?A():new Promise((function(t,n){window.ajax.post("al_stories.php",{act:"get_narrative_editor_data",owner_id:e},{loader:!0,onDone:function(e){h=e.stories,S=e.storiesCount,E=e.publishHash,w=e.editHash,b=e.linkData,C=e.isEditingLinksAvailable,T=e.coverUploadConfig,t([h,S,E,w,b,C,T])},onFail:function(e){return n(e),!0}})})).then((function(){A()})).catch((function(e){(0,u.showDoneBox)(e||(0,d.getLang)("global_error")),(0,f.logError)(e)}))}function b(e){var t=e.ownerId,n=e.onClose,i=e.onSave,a=e.onRemove,h=e.onReorder,f=e.navScreen,m={narratives:[],ownerId:t,boxAct:"get_narrative_box_data"},v=!1;function y(){return D(m).then((function(){w()})).catch((function(e){(0,u.showDoneBox)(e||(0,d.getLang)("global_error"))}))}function w(){if(m.boxData){var e=m.boxData.canEdit?l.BoxType.edit:l.BoxType.view;(0,s.updateCurrentComponentInBox)(o.createElement(c.NarrativeBox,{type:e,boxData:m.boxData,narratives:m.narratives,onClose:P,onSave:b,onRemove:C,onBookmark:k,onReorder:A,loadMore:y,navScreen:f}))}}function b(e){i&&i(e),v=!0}function C(e){var t,n,r;t=e,n={title:(0,d.getLang)("global_warning")},r=function(e){var n=m.boxData;n&&window.ajax.post("al_stories.php",{act:"remove_narrative",narrative_raw:t.rawId,hash:n.removeHash},{onDone:function(){n.count-=1,(0,g.sendNarrativeAnalytic)(g.NarrativeAnalyticEventType.deleteNarrative,t,f),m.narratives=m.narratives.filter((function(e){return e.rawId!==t.rawId})),w(),(0,u.showDoneBox)((0,d.getLang)("stories_deleted_narrative")),a&&a()},onFail:function(e){return(0,u.showDoneBox)(e||(0,d.getLang)("global_error")),!0},showProgress:function(){return(0,_.lockButton)(e)},hideProgress:function(){(0,u.curBox)().hide(),(0,_.unlockButton)(e)}})},(0,p.showFastBox)(n,(0,d.getLang)("stories_narrative_remove_warning"),(0,d.getLang)("stories_remove_confirm"),r,(0,d.getLang)("global_cancel"))}function S(){v&&P()}function P(){m.box&&m.box.hide()}function A(e){m.narratives=e,w(),h&&h()}function k(e){e.isBookmarked=!e.isBookmarked,w()}T(m).then((function(e){var t=(0,r.__read)(e,3),i=t[0],a=t[1],u=t[2];m.narratives=i,m.boxData=a,m.startFrom=u,m.box=function(e,t){var r=t.canEdit?l.BoxType.edit:l.BoxType.view;return(0,s.showComponentInBox)(o.createElement(c.NarrativeBox,{type:r,boxData:t,narratives:e,loadMore:y,onClose:P,onSave:b,onReorder:A,onBookmark:k,onRemove:C,navScreen:f}),{width:E,onShow:S,onDestroy:function(e){(0,s.destroyComponentInBox)(e),n&&n()}})}(i,a)})).catch((function(e){(0,u.showDoneBox)(e||(0,d.getLang)("global_error")),n&&n()}))}function C(e){var t=e.story,n=e.onClose,i=e.onStoryLinkUpdate,a=e.linkData;t.linkType&&t.linkText&&(a.items.find((function(e){return e.value===t.linkType}))||(a=(0,r.__assign)((0,r.__assign)({},a),{items:(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(a.items)),[{value:t.linkType,label:t.linkText}])})));var c=(0,s.showComponentInBox)(o.createElement(h.StoryLinkEditorBox,{story:t,onClose:function(){c&&c.hide()},onStoryLinkUpdate:i,linkData:a}),{width:450,onDestroy:function(e){(0,s.destroyComponentInBox)(e),n&&n()}})}function S(e){var t=e.coverUrl,n=e.coverHeight,r=e.coverWidth,i=e.thumbHeight,a=e.thumbWidth,c=e.onClose,l=e.onSave,u=e.crop,d=(0,s.showComponentInBox)(o.createElement(v.NarrativeCoverCropper,{coverUrl:t,coverHeight:n,coverWidth:r,thumbHeight:i,thumbWidth:a,onClose:function(){d&&d.hide()},onSave:l,crop:u}),{width:638,onDestroy:function(e){(0,s.destroyComponentInBox)(e),c&&c()}})}function T(e,t){return void 0===t&&(t=!1),new Promise((function(n,r){window.ajax.post("al_stories.php",{act:e.boxAct,owner_id:e.ownerId,start_from:e.startFrom,track_code:e.trackCode},{loader:!e.narratives.length&&!t,onDone:function(e,t,r){n([e,t,r])},onFail:function(e){return r(e),!0}})}))}function D(e){return T(e).then((function(t){var n,o=(0,r.__read)(t,3),i=o[0],a=o[2];return e.narratives=(null===(n=e.narratives)||void 0===n?void 0:n.concat(i))||i,e.startFrom=a,i}))}},25696:(e,t,n)=>{"use strict";n.d(t,{hideAllLayers:()=>u});n(75632);var r=n(49535),o=n(15544),i=(n(86125),[]),a=function(){window.cur.storyLayer&&window.cur.storyLayer.onVisibilityChange()},s=function(){window.cur.storyLayer&&window.cur.storyLayer.onResize()},c=function(e){window.cur.storyLayer&&window.cur.storyLayer.onKeyDown(e)},l=function(e){window.cur.storyLayer&&window.cur.storyLayer.onKeyUp(e)};function u(e){void 0===e&&(e=!1);for(var t=0;t<i.length;t++)i[t].hide(!0);if(window.layers.fullhide=!1,(0,o.removeClass)(document.body,"stories_layer_shown"),(0,o.re)("stories_layers_background"),(0,r.removeEvent)(window,"visibilitychange",a),(0,r.removeEvent)(window,"resize",s),(0,r.removeEvent)(document,"keydown",c),(0,r.removeEvent)(document,"keyup",l),e){var n=window.nav.objLoc;delete n.w,window.nav.setLoc(n)}window.cur.needUpdateFeedStories&&window.Stories.updateFeedStories(),i=[]}window.LayersX=i},33228:(e,t,n)=>{"use strict";n.d(t,{removeStoryList:()=>r});n(70655),n(41319),n(15544),n(19331);function r(e){delete window.cur["stories_list_"+e]}},46549:(e,t,n)=>{"use strict";n.d(t,{createAppearanceModifier:()=>o,createSizeModifier:()=>i,createElement:()=>a,setContent:()=>s});var r=n(30104);function o(e){return"FlatButton--"+e}function i(e){return"FlatButton--size-"+e}function a(e,t){var n=document.createElement(e);return t&&(n.className=t),n}function s(e,t){null!=t&&((0,r.emptyNode)(e),"string"==typeof t?e.innerHTML=t:e.appendChild(t))}},24041:(e,t,n)=>{"use strict";n.d(t,{FlatButton:()=>u,FlatButtonAppearance:()=>s.FlatButtonAppearance,FlatButtonSize:()=>s.FlatButtonSize});var r=n(59397),o=n(62816),i=n(60804),a=n(46549),s=n(57047),c=n(66342);function l(e){return!!e&&e.classList.contains("FlatButton--locked")}var u={isFlatButton:function(e){return Boolean(e&&e.classList&&e.classList.contains("FlatButton"))},lock:function(e){if(e&&!l(e)){var t=e.classList.contains((0,a.createSizeModifier)(s.FlatButtonSize.L)),n=t?(0,i.getIcon24Spinner)().icon:(0,o.getIcon16Spinner)().icon,c=(0,a.createElement)("span",(0,r.classNames)("FlatButton__spinner",{"FlatButton__spinner--l":t}));c.innerHTML=n,e.appendChild(c),e.classList.add("FlatButton--locked")}},unlock:function(e){var t;e&&(null===(t=e.querySelector(".FlatButton__spinner"))||void 0===t||t.remove(),e.classList.remove("FlatButton--locked"))},isLocked:l,isDisabled:function(e){return!!e&&e.classList.contains("FlatButton--disabled")},render:c.render,setDisabled:function(e,t){void 0===t&&(t=!0),e&&("button"===e.tagName.toLowerCase()&&(e.disabled=t),e.classList.toggle("FlatButton--disabled",t))},setAppearance:function(e,t){e&&Object.values(s.FlatButtonAppearance).forEach((function(n){e.classList.toggle((0,a.createAppearanceModifier)(n),n===t)}))},setSize:function(e,t){e&&Object.values(s.FlatButtonSize).forEach((function(n){e.classList.toggle((0,a.createSizeModifier)(n),n===t)}))},setLabel:function(e,t){var n=null==e?void 0:e.querySelector(".FlatButton__content");n&&(0,a.setContent)(n,t)},setBefore:function(e,t){var n=null==e?void 0:e.querySelector(".FlatButton__in");if(n){var r=e.querySelector(".FlatButton__before");null!=t?r?(0,a.setContent)(r,t):n.prepend((0,c.renderBefore)(t)):null==r||r.remove()}},setAfter:function(e,t){var n=null==e?void 0:e.querySelector(".FlatButton__in");if(n){var r=e.querySelector(".FlatButton__after");null!=t?r?(0,a.setContent)(r,t):n.prepend((0,c.renderAfter)(t)):null==r||r.remove()}}}},66342:(e,t,n)=>{"use strict";n.d(t,{render:()=>a,renderBefore:()=>s,renderAfter:()=>c});var r=n(70655),o=n(59397),i=n(46549);function a(e){var t,n=e.children,a=e.before,l=e.after,u=e.className,d=e.appearance,_=e.size,p=e.round,h=e.wide,f=e.flexWide,m=e.href,g=e.disabled,v=e.noPointerEventsForContent,y=e.restAttrs,E=void 0===y?{}:y,w=e.dangerousAttrbutesCode,b=(0,r.__assign)({},E);m?(t=document.createElement("a"),b.href=m):(t=document.createElement("button"),b.type||(b.type="button"));var C=t.tagName.toLowerCase();t.className=(0,o.classNames)("FlatButton",(0,i.createAppearanceModifier)(d),(0,i.createSizeModifier)(_),{"FlatButton--round":p,"FlatButton--wide":h,"FlatButton--flexWide":f,"FlatButton--disabled":g},u),Object.entries(b).forEach((function(e){var n=(0,r.__read)(e,2),o=n[0],i=n[1];null!=i&&t.setAttribute(o,String(i))})),g&&"button"===C&&(t.disabled=!0);var S=(0,i.createElement)("span",(0,o.classNames)("FlatButton__in",{"FlatButton__in--noPointerEvents":v}));t.appendChild(S);var T=(0,i.createElement)("span","FlatButton__content");if((0,i.setContent)(T,n),a&&S.appendChild(s(a)),S.appendChild(T),l&&S.appendChild(c(l)),w){var D=document.createElement("div");D.innerHTML="<div "+w+"></div>";var P=D.firstElementChild;if(!P)return t;var A=P.attributes;Object.keys(A).forEach((function(e){var n=A[Number(e)],r=n.value;null!=r&&t.setAttribute(n.name,r)}))}return t}function s(e){var t=(0,i.createElement)("span","FlatButton__before");return(0,i.setContent)(t,e),t}function c(e){var t=(0,i.createElement)("span","FlatButton__after");return(0,i.setContent)(t,e),t}},57047:(e,t,n)=>{"use strict";n.d(t,{FlatButtonAppearance:()=>r,FlatButtonSize:()=>o});var r={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",POSITIVE:"positive",NEGATIVE:"negative",OVERLAY_PRIMARY:"overlay-primary"},o={S:"s",M:"m",L:"l"}},64702:(e,t,n)=>{"use strict";n.d(t,{PageActionCell:()=>s});var r=n(15544),o=n(62816);function i(e){return null!=e&&e.classList.contains("PageActionCell")}var a="PageActionCell--locked";var s={isPageActionCell:i,isLocked:function(e){return i(e)&&e.classList.contains(a)},lock:function(e){e&&(e.classList.contains(a)||(e.lockTimeout&&clearTimeout(e.lockTimeout),e.resetLockTimeout=!1,e.lockTimeout=window.setTimeout((function(){if(!e.resetLockTimeout){var t=(0,r.ce)("div",{className:"PageActionCell__spinner"});t.innerHTML=(0,o.getIcon16Spinner)().icon,e.prepend(t),e.classList.add(a)}}),500)))},unlock:function(e){if(e&&(e.resetLockTimeout=!0,e.classList.contains(a))){e.classList.remove(a);var t=e.querySelector(".PageActionCell__spinner");t&&t.remove()}},update:function(e,t){var n=t.icon,r=t.label,o=t.counter,i=e.querySelector(".PageActionCell__label");if(i&&(i.innerHTML=r),void 0!==n){var a=e.querySelector(".PageActionCell__icon");a&&(a.innerHTML=n)}if(void 0!==o){var s=e.querySelector(".PageActionCell__counter");s&&(s.innerHTML=o)}},setDescription:function(e,t){var n,r=e.querySelector(".PageActionCell__description");(r||t)&&(r||((r=document.createElement("span")).className="PageActionCell__description",null===(n=e.querySelector(".PageActionCell__in"))||void 0===n||n.append(r)),t?r.innerHTML=t:r.remove())},getLabelElement:function(e){return e.querySelector(".PageActionCell__label")},getCounter:function(e){var t=e.querySelector(".PageActionCell__counter");return t&&Number(t.innerHTML)||0},setCounter:function(e,t){var n=e.querySelector(".PageActionCell__counter");!n&&t<=0||(n||((n=document.createElement("div")).classList.add("PageActionCell__counter"),e.appendChild(n)),t<=0?n.remove():n.innerHTML=String(t))}}},76772:(e,t,n)=>{"use strict";n.d(t,{UnauthActionBox:()=>d});var r=n(70655),o=n(14547),i=n(40517),a=n(15949),s=n(54612),c=n(59397),l=n(68770),u=n(67394);var d={show:function(e,t){var n=e.withForm,d=new s.MessageBox({title:"",width:n?796:450,hideButtons:!0,containerClass:(0,c.classNames)("UnauthActionBoxContainer",{"UnauthActionBoxContainer--form":n}),onHide:function(){t&&t()}});d.content(e.html),d.changed=!0;var _=d.bodyNode.querySelector(".UnauthActionBox__close"),p=d.bodyNode.querySelector(".UnauthActionBox__join"),h=d.bodyNode.querySelector(".UnauthActionBox__login"),f=function(t){o.marketingTransitionItemStat.logEvent(i.MarketingTransitionItemCampaignType.UNAUTH_ACTION_BOX,t,e.action,window.location.href)};null==_||_.addEventListener("click",(function(){f(i.MarketingTransitionItemEventType.CLOSE),d.hide()})),null==p||p.addEventListener("click",(function(){f(i.MarketingTransitionItemEventType.CLICK_SIGN_UP),(0,a.showJoinBox)()})),null==h||h.addEventListener("click",(function(){f(i.MarketingTransitionItemEventType.CLICK_SIGN_IN),(0,a.showQuickLoginBox)()})),f(i.MarketingTransitionItemEventType.OPEN),d.show();var m=d.bodyNode.querySelector(".LoginCombinedBox"),g=d.bodyNode.querySelector(".JoinForm"),v=function(e){e.preventDefault(),f(i.MarketingTransitionItemEventType.CLOSE),d.hide()};return d.bodyNode.querySelectorAll(".LoginBox").forEach((function(e){(0,l.initLoginBoxForm)(e)})),d.bodyNode.querySelectorAll(".LoginBox__notNow").forEach((function(e){e.addEventListener("click",v)})),d.bodyNode.querySelectorAll(".JoinForm__signIn, .LoginRecentBox__alternative").forEach((function(e){e.addEventListener("click",(function(){f(i.MarketingTransitionItemEventType.CLICK_SIGN_IN)}))})),d.bodyNode.querySelectorAll(".LoginBox__buttonSignUp").forEach((function(e){e.addEventListener("click",(function(){f(i.MarketingTransitionItemEventType.CLICK_SIGN_UP)}))})),m?(0,l.initLoginCombinedBoxForm)(m,e.formOptions):g&&(0,u.initJoinForm)(g,(0,r.__assign)((0,r.__assign)({},e.formOptions),{onSignInClick:function(){(0,a.showQuickLoginBox)()},onNotNowClick:v,ref:"box"})),requestAnimationFrame((function(){return window.tooltips&&window.tooltips.hideAll()})),d}}},73271:(e,t,n)=>{"use strict";n.d(t,{isUnauthorizedMediaLayerBoxAvailable:()=>s,UnauthorizedSourceType:()=>a.UnauthorizedSourceType,Unauthorized:()=>l});var r,o=n(76772),i=n(19331),a=n(59866);function s(){return!window.vk.id&&!window.layers.visible&&(0,i.partConfigEnabled)("unauthorized_media_layer_box")&&!!document.querySelector(".PageBottomBanner--unauth")}var c=!1;var l={initScrollMoreBox:function(e){var t,n=function(){c=!1,window.removeEventListener("scroll",r)};n(),r=function(){var t;c||((null===(t=window.layers)||void 0===t?void 0:t.visible)||window.cur.unauthScrollMoreBox||window.pageYOffset>=2*window.innerHeight&&(c=!0,o.UnauthActionBox.show(e)))},e.showOnLoad&&(c=!0,o.UnauthActionBox.show(e)),window.addEventListener("scroll",r),null===(t=window.cur.beforeNavigateRequestHandlers)||void 0===t||t.push((function(){return n()}))},showMoreBox:function(e,t,n,r){e&&e.preventDefault(),window.ajax.post("/al_index.php?act=a_unauthorized_box",{action:"more",owner_id:t,source:n},{loader:!0,onDone:function(e){e.unauth_action_box?o.UnauthActionBox.show(e.unauth_action_box,r):r&&r()}})}}},8046:(e,t,n)=>{"use strict";n.d(t,{idlizeCall:()=>r});var r=function(e,t){void 0===t&&(t=1e3);var n=function(){setTimeout((function(){return e()}),t)};return"requestIdleCallback"in window?window.requestIdleCallback(n,{timeout:5e3}):n()}},53580:(e,t,n)=>{"use strict";n.d(t,{WallDataEvents:()=>i,emitEvent:()=>s});n(70655);var r=n(61508),o=n(69687),i={post_reactions_counts_update:"wall/post_reactions_counts_update",reply_reactions_counts_update:"wall/reply_reactions_counts_update"},a=(0,o.makeSharedState)("wall-data",(function(){return{emitter:new r.default,keyedListeners:Object.create(null)}})),s=function(e,t){a().emitter.emit(e,t)}},10277:(e,t,n)=>{"use strict";n.d(t,{updateAriaLabelCounter:()=>i});var r=n(86067),o=n(25698),i=function(e,t,n){if("number"==typeof t&&e instanceof HTMLElement&&e.classList.contains("PostBottomAction")){var i=function(e){var t=void 0;switch(e){case o.LikeButtonTypes.comment:t=(0,r.getLang)("likes_comments_N_aria_short","raw");break;case o.LikeButtonTypes.like:t=(0,r.getLang)("likes_likes_N_aria_short","raw");break;case o.LikeButtonTypes.share:t=(0,r.getLang)("likes_shares_N_aria_short","raw")}return t}(n);if(i){var a=(0,r.langNumeric)(t,i,!1);e.setAttribute("aria-label",a)}}}},73674:(e,t,n)=>{"use strict";n.d(t,{CallStatSource:()=>p.CallStatSource});var r,o,i,a,s,c,l,u,d=n(64380),_=n(61108),p=n(63035);!function(e){e.NEURAL="NEURAL",e.SIMPLE="SIMPLE",e.NONE="NONE"}(l||(l={})),function(e){e.SD="SD",e.HD="HD",e.FHD="FHD"}(u||(u={}));var h,f,m,g,v,y,E,w,b,C,S,T,D,P,A,k;(r={})[_.OS.WINDOWS]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls.exe",r[_.OS.MAC]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls.dmg",r[_.OS.LINUX]={deb:(o={},o[_.ARCH.X64]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls-amd64.deb",o[_.ARCH.X86]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls-i386.deb",o),rpm:(i={},i[_.ARCH.X64]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls-x86_64.rpm",i[_.ARCH.X86]="https://vkcalls-native-ac.vk-apps.com/latest/vk-calls-i686.rpm",i)},(a={})[_.OS.WINDOWS]="vk-calls.exe",a[_.OS.MAC]="vk-calls.dmg",a[_.OS.LINUX]={deb:(s={},s[_.ARCH.X64]="vk-calls-amd64.deb",s)};!function(e){e[e.SD=360]="SD",e[e.HD=720]="HD",e[e.FHD=1080]="FHD"}(h||(h={})),function(e){e[e.SD=640]="SD",e[e.HD=1280]="HD",e[e.FHD=1920]="FHD"}(f||(f={})),function(e){e[e.SINGLE=0]="SINGLE",e[e.ALL=1]="ALL",e[e.SINGLE_AUDIO=2]="SINGLE_AUDIO",e[e.SINGLE_VIDEO=3]="SINGLE_VIDEO",e[e.ALL_AUDIO=4]="ALL_AUDIO",e[e.ALL_VIDEO=5]="ALL_VIDEO"}(m||(m={})),function(e){e[e.DENY=0]="DENY",e[e.ONCE=1]="ONCE",e[e.ALLOW=1/0]="ALLOW"}(g||(g={})),function(e){e[e.DECLINE=0]="DECLINE",e[e.PROCESS=1]="PROCESS",e[e.FATAL=2]="FATAL"}(v||(v={})),function(e){e.ALREADY_IN_CALL="already_in_call",e.CANT_REACH_API="cant_reach_api"}(y||(y={})),function(e){e.MIC_CAMERA_PERMISSION="mic_camera",e.CAMERA_PERMISSION="camera",e.MIC_PERMISSION="mic",e.CAMERA_ACCESS="cameralock",e.MIC_ACCESS="miclock",e.MIC_NOT_FOUND="nomic",e.SCREEN_PERMISSION="screenpermission",e.SCREEN_ACCESS="screenlock"}(E||(E={})),function(e){e.AUTH="auth"}(w||(w={})),function(e){e[e.HEADER=0]="HEADER",e[e.CALL_ALL_IN_CHAT=1]="CALL_ALL_IN_CHAT",e[e.MEMBERS_MORE=2]="MEMBERS_MORE",e[e.FRIENDS_MORE=3]="FRIENDS_MORE",e[e.GROUP_MEMBERS_MORE=4]="GROUP_MEMBERS_MORE"}(b||(b={})),function(e){e[e.READY=0]="READY",e[e.CALL=1]="CALL",e[e.INCOMING=2]="INCOMING",e[e.JOIN=3]="JOIN",e[e.ERROR=4]="ERROR",e[e.FEEDBACK=5]="FEEDBACK",e[e.START=6]="START",e[e.CALL_BY=7]="CALL_BY",e[e.CREATE_CALL=8]="CREATE_CALL",e[e.BLOCK=9]="BLOCK"}(C||(C={})),function(e){e.LOAD_PEERS="load_peer",e.CHANGE_MODE="change_mode",e.CALL_STATE="call_state",e.REMOVE_USER="remove_user",e.TIME_START="time_start",e.LOCAL_TIME_START="local_time_start",e.HANGUP="hangup",e.SET_CHAT_INFO="set_chat_info",e.GROUP_CALL_SETUP="group_call_setup",e.TOGGLE_POPUP="toggle_popup",e.UPDATE_HASH="update_hash",e.CHANGE_UI_MODE="change_ui_mode",e.SET_ORATOR="set_orator",e.TOGGLE_ORATOR_MODE="toggle_orator_mode",e.TOGGLE_PARTICIPANTS_ASIDE="toggle_participants_aside",e.SET_PINNED_PARTICIPANT="set_pinned_participant",e.SET_ADMIN_PINNED_PARTICIPANT="set_admin_pinned_participant",e.SET_SCREEN_SHARING_PINNED_PARTICIPANT="set_screen_sharing_pinned_participant",e.MANAGEMENT="management",e.CALL_NOTIFICATION="call_notification",e.JOIN="join",e.CALL_BY_NAME="call_by_name",e.CREATE_CALL_BY_LINK="create_call_by_link",e.ERROR="error",e.CHANGE_PARTICIPANT_ROLES="change_participant_roles",e.SET_SCREEN_SHARER="set_screen_sharer",e.SET_FRIENDS="set_friends",e.SET_GROUP_MEMBERS="set_group_members",e.SET_FOUNDED_GROUP_MEMBERS="set_group_members",e.SET_SPEAKERS="set_speakers",e.UPDATE_PARTICIPANTS_BATCH="update_participants_batch",e.SET_UNREAD_COUNT="set_unread_count",e.SHOW_CAUTION_BOX="show_caution_box",e.SHOW_LOADER="show_loader",e.SET_TOOLTIP="set_tooltip",e.MANUAL_ADD_PARTICIPANTS="manual_add_participants",e.SET_TRANSLATION="set_translation",e.UPDATE_ANON_SECRET="update_anon_token",e.TOGGLE_PARTICIPANTS_MANAGEMENT="toggle_participants_management",e.TOGGLE_PARTICIPANTS_KICK="toggle_participants_kick",e.TOGGLE_ADMIN_ASSIGNMENT="toggle_admin_assignment",e.SET_NOISE_CANCELLATION="set_noise_cancellation",e.CHANGE_LOCAL_VIDEO_RESOLUTION="change_local_video_resolution",e.SET_CONVERSATION_OPTIONS="set_conversation_options",e.SET_PRIVACY_SETTINGS="set_privacy_settings",e.UNBAN_PARTICIPANTS="unban_participants",e.SET_GROUP="set_group",e.SET_WAITING_HALL="set_waiting_hall",e.SET_PUSH_TO_TALK_ENABLE="set_push_to_talk_enable",e.SET_GRID_SCROLL_POSITION="set_grid_scroll_position",e.SET_ORATOR_SCROLL_POSITION="set_orator_scroll_position",e.SET_SHOW_DESKTOP_NOTIFICATION="set_show_desktop_notification",e.SET_SHOW_WARNING_DESKTOP_NOTIFICATION="set_show_warning_desktop_notification",e.SET_START_OPTIONS="set_start_params",e.VB_SET_USER_PHOTOS="vb_set_user_photos",e.VB_ADD_USER_PHOTO="vb_add_user_photo",e.VB_REMOVE_USER_PHOTO="vb_remove_user_photo",e.VB_SET_VIDEO_OPTIONS="vb_set_video_options",e.SET_CALL_PERMISSIONS="set_call_permissions",e.CLEAN_LAST_CALL_DATA="clean_last_call_data",e.SET_LAST_CALL_DATA="set_last_call_data",e.SET_LOCAL_DEVICE="set_local_device"}(S||(S={})),function(e){e.AUDIO="audio",e.VIDEO="video"}(T||(T={})),function(e){e.DEFAULT="default",e.COLLAPSED="collapsed",e.FULLSCREEN="fullscreen"}(D||(D={})),function(e){e.SPEAKING_ON_MUTE="SPEAKING_ON_MUTE",e.RAISED_HAND="RAISED_HAND",e.SCREEN_SHARING_STARTED="SCREEN_SHARING_STARTED",e.BAD_NETWORK_CONNECTION="BAD_NETWORK_CONNECTION",e.BAD_NETWORK_CONNECTION_DISABLE_CAMERA="BAD_NETWORK_CONNECTION_DISABLE_CAMERA",e.ADMIN_ROLE_GRANTED="ADMIN_ROLE_GRANTED",e.USER_GRANTED_WITH_ADMIN_ROLE="USER_GRANTED_WITH_ADMIN_ROLE",e.PINNED_BY_ADMIN="PINNED_BY_ADMIN",e.USER_PINNED_BY_ADMIN="USER_PINNED_BY_ADMIN",e.PUSH_TO_TALK="PUSH_TO_TALK",e.CONNECTING="CONNECTING",e.LINK_COPIED_TO_CLIPBOARD="LINK_COPIED_TO_CLIPBOARD",e.ADMIN_MUTE="ADMIN_MUTE",e.ADMIN_MUTE_AUDIO="ADMIN_MUTE_AUDIO",e.ADMIN_MUTE_VIDEO="ADMIN_MUTE_VIDEO",e.ADMIN_MUTE_PERMANENT="ADMIN_MUTE_PERMANENT",e.ADMIN_MUTE_PERMANENT_AUDIO="ADMIN_MUTE_PERMANENT_AUDIO",e.ADMIN_MUTE_PERMANENT_VIDEO="ADMIN_MUTE_PERMANENT_VIDEO",e.ADMIN_UNMUTE_PERMANENT="ADMIN_UNMUTE_PERMANENT",e.ADMIN_UNMUTE_PERMANENT_AUDIO="ADMIN_UNMUTE_PERMANENT_AUDIO",e.ADMIN_UNMUTE_PERMANENT_VIDEO="ADMIN_UNMUTE_PERMANENT_VIDEO"}(P||(P={})),function(e){e.LOWERED="0",e.RAISED="1"}(A||(A={})),function(e){e.NETWORK="network_error",e.API="api_error"}(k||(k={}));var I;d.HangupType.BUSY,d.HangupType.CALLEE_IS_OFFLINE,d.HangupType.CALLER_IS_BLOCKED,d.HangupType.CANCELED,d.HangupType.EXTERNAL_API_ERROR,d.HangupType.FAILED,d.HangupType.HUNGUP,d.HangupType.MISSED,d.HangupType.NOT_FRIENDS,d.HangupType.OLD_VERSION,d.HangupType.REJECTED,d.HangupType.REMOVED,d.HangupType.SERVICE_DISABLED,d.HangupType.UNKNOWN_ERROR,d.HangupType.UNSUPPORTED;!function(e){e[e.CALL=0]="CALL",e[e.WAITING_HALL=1]="WAITING_HALL"}(I||(I={}));var O,x;!function(e){e.BACKGROUND="calls_background",e.BLUR="calls_blur",e.NONE="calls_none",e.ADD="calls_add"}(O||(O={})),function(e){e.IS_VIDEO_MIRRORED="calls_is_video_mirrored"}(x||(x={}));(c={})[d.HangupType.BUSY]="on_call_hangup_busy",c[d.HangupType.KILLED]="on_call_hangup_killed",c[d.HangupType.BANNED]="on_call_hangup_banned",c[d.HangupType.REMOVED]="on_call_hangup_removed"},61108:(e,t,n)=>{"use strict";n.d(t,{OS:()=>o,ARCH:()=>i});var r,o,i,a;n(70655),n(89588);!function(e){e.WINDOWS="windows",e.MAC="mac",e.ANDROID="android",e.IOS="ios",e.LINUX="linux",e.UNKNOWN="unknown"}(o||(o={})),function(e){e.X86="x86",e.X64="x64",e.ARM="arm"}(i||(i={})),function(e){e.CHROME="chrome",e.FIREFOX="firefox",e.SAFARI="safari",e.OPERA="opera",e.YANDEX="yandex",e.IE="ie",e.EDGE="edge"}(a||(a={}));(r={})[o.ANDROID]=/Android/i,r[o.IOS]=/(iPhone|iPad|iPod)/i,r[o.WINDOWS]=/Win/i,r[o.IOS]=/(iPhone|iPad|iPod)/i,r[o.ANDROID]=/Android/i,r[o.MAC]=/(MacPPC|MacIntel|Mac_PowerPC|Macintosh|Mac OS X)/i,r[o.LINUX]=/(Linux|X11(?!.*CrOS))/i,new Map},63035:(e,t,n)=>{"use strict";var r,o,i,a,s,c;n.d(t,{CallStatSource:()=>a}),function(e){e.AUDIO="ok_audio",e.AUDIO_TO_VIDEO="ok_video",e.VIDEO="ok_started_as_video",e.GROUP_AUDIO="group_audio",e.GROUP_AUDIO_TO_VIDEO="group_video",e.GROUP_VIDEO="group_started_as_video"}(r||(r={})),function(e){e.SUCCESS="success",e.FAIL="fail"}(o||(o={})),function(e){e.REMOTE_NO_CONNECT="push_not_delivered",e.REMOTE_FAILED_ACCEPT="cant_connect",e.REMOTE_DECLINE="declined_remote",e.LOCAL_DECLINE="declined_local",e.REMOTE_TIMEOUT="declined_timeout",e.REMOTE_BUSY="busy",e.CONNECTION_LOST="lost_connection"}(i||(i={})),function(e){e.CONVO_HEADER="im_header",e.CONVO_SNIPPET="im_message",e.CONVO_LIST="im_create",e.CONVO_JOIN_SNIPPET="im_join_message",e.CONVO_JOIN_HEADER="im_join_header",e.CONVO_JOIN_BANNER="im_join_header",e.FRIENDS_LIST="friends_list",e.LINK_JOIN_SNIPPET="join_deeplink",e.LINK_JOIN_PAGE="join_deeplink",e.PROFILE="profile",e.WIDGET="im_widget",e.FAST_CHAT="fast_chat",e.HISTORY="history",e.HISTORY_FRIENDS_LIST="history_friends_list",e.HISTORY_CREATE="history_create",e.LINK="link"}(a||(a={})),function(e){e.OUTGOING_CALL_STARTED_VIDEO="OutgoingCallStartedVideo",e.OUTGOING_CALL_STARTED_AUDIO="OutgoingCallStartedAudio",e.OUTGOING_CALL_ADD_PARTICIPANTS_SENT="OutgoingCallAddParticipantsSent",e.OUTGOING_CALL_REMOTE_RINGING="OutgoingCallRemoteRinging",e.OUTGOING_CALL_ACCEPTED_REMOTELY="OutgoingCallAcceptedRemotely",e.OUTGOING_CALL_FAILED="OutgoingCallFailed",e.OUTGOING_CALL_COMPLETED="OutgoingCallCompleted",e.INCOMING_CALL_RECEIVED="IncomingCallReceived",e.INCOMING_CALL_ACCEPTED="IncomingCallAccepted",e.CALL_DECLINED_OR_HANGED_LOCALLY="CallDeclinedOrHangedLocally",e.CALL_DECLINED_OR_HANGED_REMOTELY="CallDeclinedOrHangedRemotely",e.CALL_CONNECTED="CallConnected",e.CALL_DISCONNECTED="CallDisconnected",e.VIDEO_ENABLED="VideoEnabled",e.VIDEO_DISABLED="VideoDisabled",e.RELAY_CONNECTION_ESTABLISHED="RelayConnectionEstablished",e.USER_FEEDBACK_RECEIVED="UserFeedbackReceived",e.SYSTEM_STAT="SystemStat",e.GROUP_CALL_JOINED="GroupCallJoined",e.HAND_RAISED="HandRaised",e.HAND_LOWERED="HandLowered",e.SCREEN_SHARING_STARTED="ScreenSharingStarted",e.SCREEN_SHARING_STOPPED="ScreenSharingStopped",e.ALL_MICS_DISABLED="AllMicsDisabled",e.MIC_OFF_WHILE_TALKING_ALERT="MicOffWhileTalkingAlert",e.MIC_OFF_WHILE_TALKING_ENABLE_CLICK="MicOffWhileTalkingEnableClick",e.VIDEO_DISABLED_DUE_TO_BAD_CONNECTION_ALERT="VideoDisabledDueToBadConnectionAlert",e.ALL_MICS_AND_VIDEO_DISABLED="AllMicsAndVideoDisabled",e.USER_MICS_AND_VIDEO_DISABLED="UserMicsAndVideoDisabled",e.ASK_ALL_TO_UNMUTE="AskAllToUnmute",e.ASK_USER_TO_UNMUTE="AskUserToUnmute",e.ASSIGN_ADMIN="AssignAdmin",e.RETRIEVE_ADMIN="RetrieveAdmin",e.ADMIN_PIN="AdminPin",e.ADMIN_UNPIN="AdminUnpin",e.VIRTUAL_BACKGROUND_SELECTED="VirtualBackgroundSelected",e.VIRTUAL_BACKGROUND_DISABLED="VirtualBackgroundDisabled",e.CUSTOM_VIRTUAL_BACKGROUND_SELECTED="CustomVirtualBackgroundSelected",e.CUSTOM_VIRTUAL_BACKGROUND_ADDED="CustomVirtualBackgroundAdded",e.CUSTOM_VIRTUAL_BACKGROUND_DELETED="CustomVirtualBackgroundDeleted",e.CUSTOM_VIRTUAL_BACKGROUND_DISABLED="CustomVirtualBackgroundDisabled"}(s||(s={})),function(e){e[e.ONCE=0]="ONCE",e[e.PERMANENT=1]="PERMANENT"}(c||(c={}))},88420:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(70655),o=n(67294),i=n(59397);const a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.appearance,a=e.wide,s=e.overflow,c=e.size,l=(0,r.__rest)(e,["className","appearance","wide","overflow","size"]),u=e.disabled,d=i.classNames.apply(void 0,(0,r.__spreadArray)((0,r.__spreadArray)(["Button"],(0,r.__read)(function(e){return Array.isArray(e)?e.map((function(e){return"Button--"+e})):["Button--"+e]}(n))),["Button--size-"+c,{"Button--wide":a,"Button--overflow":!!s,"Button--disabled":u},t]));return o.createElement("button",(0,r.__assign)({},l,{className:d}),e.children)},t.defaultProps={appearance:"primary",size:"m",wide:!1,disabled:!1},t}(o.Component)},18690:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});var r=n(70655),o=n(67294),i=n(59397),a=n(47560),s=n(88420);const c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.loading,c=e.children,l=(0,r.__rest)(e,["className","loading","children"]),u=["primary","positive"].some((function(e){return e===l.appearance}));return o.createElement(s.default,(0,r.__assign)({},l,{className:(0,i.classNames)("ButtonWithProgress",{"ButtonWithProgress--loading":n},t)}),o.createElement("span",{className:"ButtonWithProgress__content"},c),n&&o.createElement(a.default,{inverted:u,className:"ButtonWithProgress__progress"}))},t.defaultProps={appearance:"primary",size:"m",wide:!1,disabled:!1,loading:!1},t}(o.Component)},13984:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var r=n(70655),o=n(67294);const i=function(e){var t=e.children,n=e.element,i=void 0===n?"span":n,a=e.className,s=(0,r.__rest)(e,["children","element","className"]),c=t?String(t):"",l=i;return o.createElement(l,(0,r.__assign)({},s,{dangerouslySetInnerHTML:{__html:c},className:a||""}))}},76288:(e,t,n)=>{"use strict";n.d(t,{ModalBody:()=>i});var r=n(67294),o=n(18793),i=function(e){var t=e.children,n=e.hasScroll;return void 0===n||n?r.createElement(o.Scroll,{className:"ModalBody"},t):r.createElement("div",{className:"ModalBody"},t)}},50382:(e,t,n)=>{"use strict";n.d(t,{ModalFooter:()=>i});var r=n(67294),o=n(59397),i=function(e){var t=e.className,n=e.actionButtons,i=e.hint,a=e.children;return r.createElement("div",{className:(0,o.classNames)("ModalFooter",t)},r.createElement("div",{className:"ModalFooter__inner"},i&&r.createElement("div",{className:"ModalFooter__hint",role:"presentation"},i),a&&r.createElement("div",{className:"ModalFooter__content"},a),n))}},43927:(e,t,n)=>{"use strict";n.d(t,{ModalHeader:()=>a});var r=n(67294),o=n(59397),i=n(33024),a=function(e){var t=e.className,n=e.title,a=e.onClose,s=e.backText,c=e.onBack,l=(0,o.classNames)("ModalHeader",t);return r.createElement("div",{className:l},s&&r.createElement("button",{className:"ModalHeader__back",onClick:c},s),r.createElement("h1",{className:"ModalHeader__title"},n),r.createElement("button",{className:"ModalHeader__cross",type:"button",onClick:a},r.createElement(i.default,{width:22,height:22}),"Закрыть"))}},43390:(e,t,n)=>{"use strict";n.d(t,{Targets:()=>r,PhotoAreaSelector:()=>_});var r,o=n(70655),i=n(67294),a=n(59397),s=n(20217);!function(e){e.NONE="none",e.MAIN="main",e.PREVIEW_50="50",e.PREVIEW_100="100",e.NW="nw",e.NE="ne",e.N="n",e.SW="sw",e.SE="se",e.S="s",e.W="w",e.E="e"}(r||(r={}));var c=[r.NW,r.NE,r.N,r.SW,r.SE,r.S,r.W,r.E],l=[r.NW,r.NE,r.SW,r.SE],u=[r.MAIN,r.PREVIEW_50,r.PREVIEW_100],d=(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(c)),(0,o.__read)(u)),_=function(e){var t=e.className,n=e.minWidth,_=e.minHeight,h=e.rect,f=e.rotate,m=void 0===f?0:f,g=e.onCropUpdated,v=e.preview50,y=void 0!==v&&v,E=e.preview100,w=void 0!==E&&E,b=e.isSquare,C=void 0!==b&&b,S=(0,i.useRef)(null),T=C?1:e.minAspectRatio||1,D=C?1:e.maxAspectRatio||1,P=C?l:c,A=h||(0,s.getInitRect)(e),k=(0,o.__read)((0,s.getThumbSize)(e,A),7),I=k[0],O=k[1],x=k[2],R=k[3],M=k[4],L=k[5],N=k[6];function B(e){return e*N}function U(e){return e/N}var F=(0,s.getInitCrop)(e,A,T,D,U),W=(0,o.__read)((0,i.useState)(r.NONE),2),j=W[0],V=W[1],H=(0,o.__read)((0,i.useState)(F),2),K=H[0],G=H[1],z=(0,o.__read)((0,i.useState)(F),2),q=z[0],$=z[1],Y=(0,o.__read)((0,i.useState)({x:0,y:0}),2),Q=Y[0],X=Y[1],J=(0,o.__read)((0,i.useState)({x:0,y:0}),2),Z=J[0],ee=J[1],te=(0,o.__read)((0,i.useState)({x:0,y:0}),2),ne=te[0],re=te[1],oe=(0,o.__read)((0,i.useState)(!1),2),ie=oe[0],ae=oe[1],se=(0,o.__read)((0,i.useState)(!1),2),ce=se[0],le=se[1];(0,i.useEffect)((function(){var t=(0,s.getInitCrop)(e,A,T,D,U);t.left===K.left&&t.top===K.top&&t.width===K.width&&t.height===K.height||(G(t),$(t)),g({left:Math.floor(t.left),top:Math.floor(t.top),width:Math.floor(t.width),height:Math.floor(t.height)})}),[m]);var ue=d.reduce((function(e,t){var n;return e[t]=(n=t,function(e){var t=e.pageX,o=e.pageY,i=(0,s.getXY)(S.current),a={x:K.left,y:K.top};if(c.includes(n)){var l=[n.charAt(0),n.length>1?n.charAt(1):n.charAt(0)];a={x:a.x+(l[1]==r.W?0:K.width),y:a.y+(l[0]==r.N?0:K.height)}}V(n),X(i),$(K),ee({x:t,y:o}),re(a),ae(!0),e.stopPropagation(),e.preventDefault()}),e}),{}),de=function(e){var t={x:e.pageX,y:e.pageY};u.includes(j)?((0,s.move)(A,K,q,Z,t,G,U),document.body.style.cursor="move"):c.includes(j)&&((0,s.resize)(A,t,ne,K,j,Q,n,_,T,D,U,re,V,G),document.body.style.cursor=j+"-resize"),e.stopPropagation(),e.preventDefault()},_e=function(e){V(r.NONE),ae(!1),g(K),document.body.style.cursor="",e.stopPropagation(),e.preventDefault()};(0,i.useEffect)((function(){return ie?(window.addEventListener("mousemove",de),window.addEventListener("mouseup",_e)):(window.removeEventListener("mousemove",de),window.removeEventListener("mouseup",_e)),function(){window.removeEventListener("mousemove",de),window.removeEventListener("mouseup",_e)}}),[ie,de,_e]);var pe=(0,a.classNames)("PhotoAreaSelector",ie?"PhotoAreaSelector--drag-yes":"PhotoAreaSelector--drag-no",t),he=(0,o.__read)((0,s.rectToThumbSize)(K,A,B),6),fe=he[0],me=he[1],ge=he[2],ve=he[3],ye=he[4],Ee=he[5],we=m%4*90,be="center";return 1===m?be=R/2+"px "+R/2+"px":3===m&&(be=x/2+"px "+x/2+"px"),i.createElement("div",{className:pe},i.createElement("div",{className:"PhotoAreaSelector__mainWrapper",style:{width:I,height:O}},i.createElement("div",{className:"PhotoAreaSelector__frameWrapper",style:{width:I,height:O}},i.createElement("img",{src:e.imgSrc,style:{transformOrigin:be,width:x,height:R,willChange:"transform",transform:"translate("+M+"px, "+L+"px) rotate("+we+"deg)"},ref:S})),i.createElement("div",{className:"PhotoAreaSelector__faded"}),i.createElement("div",{className:"PhotoAreaSelector__linza",style:{width:fe,height:me}},i.createElement("div",{className:"PhotoAreaSelector__linzaFrame",style:{transform:"translate("+ge+"px, "+ve+"px)"},onMouseDown:ue[r.MAIN]},i.createElement("div",{className:"PhotoAreaSelector__linzaBorder"},i.createElement("img",{className:(0,a.classNames)("PhotoAreaSelector__linzaImage",{"PhotoAreaSelector__linzaImage--loaded":ce}),onLoad:function(){return le(!0)},src:e.imgSrc,style:{transformOrigin:be,width:x,height:R,transform:"translate("+-ye+"px, "+-Ee+"px) rotate("+we+"deg)"}})))),i.createElement(i.Fragment,null,P.map((function(e){var t=0,n=0;if(1===e.length)e===r.N||e===r.S?(t=B(K.left+K.width/2)-5,n=B(K.top+(e===r.N?0:K.height))-5):(t=B(K.left+(e===r.W?0:K.width))-5,n=B(K.top+K.height/2)-5);else{var o=e.charAt(0),s=e.charAt(1);t=B(K.left+(s===r.W?0:K.width))-5,n=B(K.top+(o===r.N?0:K.height))-5}var c=(0,a.classNames)("PhotoAreaSelector__handler","PhotoAreaSelector__handler--type-"+e,ie?"PhotoAreaSelector__handler--dragged-yes":"PhotoAreaSelector__handler--dragged-no");return i.createElement("div",{key:e,className:c,style:{transform:"translate("+t+"px, "+n+"px)"},onMouseDown:ue[e]})})))),C&&(y||w)?i.createElement("div",{className:"PhotoAreaSelector__previewsWrapper"},w&&p(100,K,A,e,ue[r.PREVIEW_50]),y&&p(50,K,A,e,ue[r.PREVIEW_100])):null)};function p(e,t,n,r,o){var s=r.imgWidth,c=r.imgHeight,l=r.rotate,u=void 0===l?0:l,d=(0,a.classNames)("PhotoAreaSelector__preview","PhotoAreaSelector__preview--"+e),_=(0,a.classNames)("PhotoAreaSelector__previewWrapper","PhotoAreaSelector__previewWrapper--"+e),p=-Math.floor((n.left+t.left)*e/t.width),h=-Math.floor((n.top+t.top)*e/t.width),f=Math.ceil(s*e/t.width),m=Math.ceil(c*e/t.height),g=u%4*90,v="center";return 1===u?v=m/2+"px "+m/2+"px":3===u&&(v=f/2+"px "+f/2+"px"),i.createElement("div",{className:d},i.createElement("div",{onMouseDown:o,className:_},i.createElement("img",{src:r.imgSrc,style:{width:f,height:m,transformOrigin:v,willChange:"transform",transform:"translate("+p+"px, "+h+"px) rotate("+g+"deg)"}})))}},20217:(e,t,n)=>{"use strict";n.d(t,{resize:()=>i,move:()=>a,getInitRect:()=>s,getThumbSize:()=>c,getInitCrop:()=>l,rectToThumbSize:()=>u,getXY:()=>_});var r=n(70655),o=n(43390);function i(e,t,n,r,i,a,s,c,l,u,_,h,f,m){var g=function(e,t,n,r){return{x:p(Math.max(0,r(e.x-t.x)-n.left)),y:p(Math.max(0,r(e.y-t.y)-n.top))}}(t,a,e,_),v=g.x-n.x,y=g.y-n.y;if(s=_(s),c=_(c),v||y){var E=e.width,w=e.height,b=r.left,C=r.top,S=r.width,T=r.height,D=0,P=0;2===i.length?(D=i.startsWith(o.Targets.N)?-1:1,P=i.charAt(1)===o.Targets.W?-1:1):(D=i===o.Targets.N?-1:i===o.Targets.S?1:0,P=i===o.Targets.W?-1:i===o.Targets.E?1:0),D&&T+d(D)*y<c/2&&(D=-D,y=g.y-(r.top+(D>0?r.height:0))),P&&S+d(P)*v<s/2&&(P=-P,v=g.x-(r.left+(P>0?r.width:0)));var A=D?d(D):0,k=P?d(P):0;l>0&&S+k*v<(T+A*y)*l&&(P?v=k*Math.ceil((T+A*y)*l-S):y=A*Math.floor(S/l-T)),u>0&&S+k*v>(T+A*y)*u&&(D?y=A*Math.ceil((S+k*v)/u-T):v=k*Math.floor(T*u-S)),D&&((T+=d(D)*y)<c?(C-=D>0?0:c-T-y,T=c):C+=D>0?0:y),P&&((S+=d(P)*v)<s?(b-=P>0?0:s-S-v,S=s):b+=P>0?0:v);var I=0,O=0,x=0,R=0;b<0?(I=b,b=0):S>E-b&&(I=E-b-S),I&&(S+=I,l>0&&S<l*T&&(T+=R=Math.floor(S/l)-T,C-=D>0?0:R)),C<0?(O=C,C=0):T>w-C&&(O=w-C-T),O&&(T+=O,u>0&&S>u*T&&(S+=x=Math.floor(T*u)-S,b-=P>0?0:x));var M=D>0?o.Targets.S:D<0?o.Targets.N:"",L=P>0?o.Targets.E:P<0?o.Targets.W:"",N={left:p(b),top:p(C),width:p(S),height:p(T)};if(r.top!==N.top||r.left!==N.left||r.width!==N.width||r.height!==N.height){m(N),h({x:N.left+(P>0?N.width:0),y:N.top+(D>0?N.height:0)});var B=M+L;B!==i&&f(B)}}}function a(e,t,n,o,i,a,s){var c=Math.round(n.left+s(i.x-o.x)),l=Math.round(n.top+s(i.y-o.y)),u=p(Math.min(Math.floor(e.width-t.width),Math.max(0,c))),d=p(Math.min(Math.floor(e.height-t.height),Math.max(0,l)));t.left===u&&t.top===d||a((0,r.__assign)((0,r.__assign)({},t),{left:u,top:d}))}function s(e){var t=e.rotate,n=void 0===t?0:t;return{left:0,top:0,width:n%2?e.imgHeight:e.imgWidth,height:n%2?e.imgWidth:e.imgHeight}}function c(e,t){var n=e.previewWidth,r=e.previewHeight,o=e.imgWidth,i=e.imgHeight,a=t.left,s=t.top,c=t.width,l=t.height,u=c-a,d=l-s;if(n){var _=n,p=_/c,h=Math.floor(l*p);return r&&u<d&&(p=(h=r)/l,_=Math.floor(c*p)),[_,h,_*(o/c),h*(i/l),-1*a*p,-1*s*p,p]}return[u,d,o,i,-a,-s,1]}function l(e,t,n,r,o){if(e.cropRect)return e.cropRect;var i=t.width,a=t.height,s=e.minWidth,c=e.minHeight;s=o(s),c=o(c);var l={left:Math.floor(.1*i),top:Math.floor(.1*a),width:Math.floor(.8*i),height:Math.floor(.8*a)};if(l.width<s){var u=s>i?i:s;l.left=Math.max(0,l.left-Math.floor((u-l.width)/2)),l.width=u}if(l.height<c){var d=c>a?a:c;l.left=Math.max(0,l.top-Math.floor((d-l.height)/2)),l.height=d}return l.width<l.height*n&&(l.top=Math.max(0,l.top-Math.floor((l.width/n-l.height)/4)),l.height=Math.floor(l.width/n)),l.width>l.height*r&&(l.left=Math.max(0,l.left-Math.floor((l.height*r-l.width)/2)),l.width=Math.floor(l.height*r)),(i<l.left+l.width||a<l.top+l.height)&&(i<a?(l.left=0,l.top=Math.max(0,Math.floor((a-i)/2)),l.width=i,l.height=i):(l.left=Math.max(0,Math.floor((i-a)/2)),l.top=0,l.width=a,l.height=a)),l}function u(e,t,n){return[p(n(e.width)),p(n(e.height)),p(n(e.left)),p(n(e.top)),p(n(e.left+t.left)),p(n(e.top+t.top))]}function d(e){return e<0?-1:1}function _(e){var t=e.ownerDocument,n=e.getBoundingClientRect();if(!t)return{x:0,y:0};var r=t.documentElement;return{x:n.left+r.scrollLeft-(r.clientLeft||0),y:n.top+r.scrollTop-(r.clientTop||0)}}function p(e){return Number(e.toFixed(2))}},14217:(e,t,n)=>{"use strict";n.d(t,{Popper:()=>c});var r=n(70655),o=n(67294),i=n(94021),a=n(30810),s=n(59397),c=o.forwardRef((function(e,t){var n=e.open,c=void 0===n||n,l=e.position,u=void 0===l?"auto":l,d=e.mode,_=void 0===d?"side":d,p=e.align,h=void 0===p?"auto":p,f=e.attachTarget,m=void 0===f?document.body:f,g=e.content,v=e.children,y=(0,r.__rest)(e,["open","position","mode","align","attachTarget","content","children"]),E=(0,o.useRef)(null),w=(0,a.useCombinedRefs)(t,E),b=(0,r.__read)((0,o.useState)(null),2),C=b[0],S=b[1],T=(0,r.__read)((0,o.useState)(null),2),D=T[0],P=T[1],A=(0,r.__read)((0,o.useState)(null),2),k=A[0],I=A[1],O=(0,r.__assign)((0,r.__assign)({},v.props),{ref:w});return(0,o.useEffect)((function(){if(w&&w.current){var e=(0,r.__read)(function(e,t,n,r,o,i){if(!i)return[null,null,null];var a="auto";if(!e)return[{top:0,left:0,width:0,height:0},o===a?"left":o,r===a?"b":r];var c=(0,s.getOffsetRect)(e),l=(0,s.getOffsetRect)(t),u=r===a||o===a,d=u?window.innerWidth:0,_=u?window.innerHeight:0,p=u?window.pageYOffset||document.documentElement.scrollTop:0,h=u?window.pageXOffset||document.documentElement.scrollLeft:0;if(r===a){var f=c.top-p;r=p+_-c.top-c.height>f?"b":"t"}if(o===a){var m=c.left+.5*c.width,g=h+2*d/3;o=m>=h+d/3&&m<=g?"center":m>g?"right":"left"}var v=c.left,y=c.top;if("side"===n)return[{top:("b"===r?y+c.height:y)-l.top,left:("r"===r?v+c.width:v)-l.left,width:"t"===r||"b"===r?c.width:0,height:"l"===r||"r"===r?c.height:0},o,r];switch(r){case"t":v+=.5*c.width;break;case"r":v+=c.width,y+=.5*c.height;break;case"b":v+=.5*c.width,y+=c.height;break;case"l":y+=.5*c.height}return[{top:y-l.top,left:v-l.left,width:0,height:0},o,r]}(w.current,m,_,u,h,c),3),t=e[0],n=e[1],o=e[2];S(t),P(n),I(o)}}),[_,u,h,w.current,c,m]),o.createElement(o.Fragment,null,o.cloneElement(v,O),c&&o.createElement(i.WithPortal,(0,r.__assign)({},y,{className:(0,s.classNames)("Popper",D&&"Popper--"+D,k&&"Popper--"+k,y.className),"data-align":D,"data-position":k,portalContainerParent:m,style:C||void 0}),g))}))},47560:(e,t,n)=>{"use strict";n.d(t,{default:()=>s});var r=n(70655),o=n(67294),i=n(59397),a=function(e){var t=e.inverted,n=e.size,a=e.className,s=(0,r.__rest)(e,["inverted","size","className"]),c=(0,i.classNames)("Progress",{"Progress--inverted":!!t},"Progress--size-"+n,a);return o.createElement("div",(0,r.__assign)({className:c},s),o.createElement("div",{className:"Progress__item"}),o.createElement("div",{className:"Progress__item"}),o.createElement("div",{className:"Progress__item"}))};a.defaultProps={inverted:!1,size:"s"};const s=a},56589:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});var r=n(70655),o=n(67294),i=n(73935),a=n(59397),s=n(89366).default;const c=function(e){function t(t){var n,i=e.call(this,t)||this;return i.handleMouseDown=function(e){i.props.onFocus&&"function"==typeof i.props.onFocus&&i.props.onFocus(i.state.opened),"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),i.props.disabled||i.props.alwaysOpened||i.toggle(!i.state.opened))},i.getOptionByValue=function(e,t){for(var n=0;n<e.length;n++)if(e.hasOwnProperty(n)){var r=e[n];if("object"==typeof r){if("group"===r.type&&void 0!==r.items){var o=i.getOptionByValue(r.items||[],t);if(o)return o}if(r.value===t)return r}else if(r===t)return r}},i.setValue=function(e,t,n){n&&n.stopPropagation(),"object"==typeof t&&i.props.searchable&&(t=t.props.title);var r={value:e,label:"object"==typeof t?t:t.toString()},o={selected:r};i.fireChangeEvent(r),i.setState(o),i.props.alwaysOpened||i.toggle(!1)},i.fireChangeEvent=function(e){e!==i.state.selected&&i.props.onChange&&i.props.onChange({name:i.props.name,selected:e})},i.renderOption=function(e){var t=(0,a.classNames)("Select__option",{"Select__option--selected":e===i.state.selected}),n=void 0!==e.value?e.value:e.label||e,r=void 0!==e.label?e.label:e;return o.createElement("div",{key:n,className:t,onMouseDown:function(e){return i.setValue(n,r,e)},onClick:function(e){return i.setValue(n,r,e)},title:e.title},r)},i.buildMenu=function(){var e=i.state.filteredOptions.map((function(e){return"string"!=typeof e&&"group"===e.type?o.createElement("div",{className:"Select__group",key:e.name},e.name&&o.createElement("div",{className:"Select__title"},e.name),e.items&&e.items.map((function(e){return i.renderOption(e)}))):i.renderOption(e)}));return e.length?e:o.createElement("div",{className:"Select__noresults"},i.props.searchPlaceholder)},i.renderMenu=function(){return i.props.customMenu?i.props.customMenu(i.state.filteredOptions,i.setValue,i.state.selected):o.createElement("div",{className:"Select__menu"},i.buildMenu())},i.filterOptions=function(e,t){var n=e.toLowerCase();return t.filter((function(e){return"string"==typeof e?e.toLowerCase().includes(n):"string"==typeof e.label?e.label.toLowerCase().includes(n):"object"==typeof e.label&&e.label.props.title.toLowerCase().indexOf(n)>=0}))},i.handleSearchType=function(e){var t=i.filterOptions(e.target.value,i.state.allOptions);i.setState({selected:{value:e.target.value,label:e.target.value},filteredOptions:t}),i.toggle(!0),i.props.onType&&i.props.onType(e.target.value)},i.handleEditableType=function(e){i.setState({opened:!0}),i.props.onEdit&&i.props.onEdit(e.target.value)},i.buildControl=function(e){var t,n,c="",l=i.props,u=l.searchable,d=l.editable,_=l.inputOtherProps,p=(0,a.classNames)("Select__input",_&&_.className);return e&&"string"==typeof e&&(c=e),e&&"object"==typeof e&&(e&&"string"==typeof e.label&&(c=e.label),e&&"object"==typeof e.label&&u&&(c=e.label.props.title||""),e&&"object"==typeof e.label&&!u&&(n=e.placeholder||e.label)),t=u?o.createElement("div",{className:"Select__control",onClick:i.handleMouseDown},o.createElement(s,(0,r.__assign)({placeholder:i.props.placeholder,value:c||"",onChange:i.handleSearchType.bind(i),onFocus:i.props.onInputFocus,onBlur:function(e){var t,n;return null===(n=(t=i.props).onInputBlur)||void 0===n?void 0:n.call(t,e,i.state.filteredOptions)},disabled:i.props.disabled,isControlledOutside:!0},_,{className:p})),o.createElement("span",{className:"Select__arrow"})):d?o.createElement("div",{className:"Select__control",onClick:i.handleMouseDown},o.createElement(s,(0,r.__assign)({placeholder:i.props.placeholder,id:i.props.id,value:c||"",onChange:i.handleEditableType,onFocus:i.props.onInputFocus,onBlur:i.props.onInputBlur,disabled:i.props.disabled,isControlledOutside:!0,autoComplete:"off"},_,{className:p})),o.createElement("span",{className:"Select__arrow"})):o.createElement("div",{className:"Select__control",onClick:i.handleMouseDown},o.createElement("div",{className:"Select__placeholder"},c||n),o.createElement("span",{className:"Select__arrow"})),t},i.handleDocumentClick=function(e){i.mounted&&i.state.opened&&!i.props.alwaysOpened&&i.el&&!i.el.contains(e.target)&&i.toggle(!1)},n=void 0!==t.value?t.editable&&void 0!==t.customValue?{label:t.customValue,value:t.customValue}:i.getOptionByValue(t.options,t.value):{label:i.getLabel(t),value:""},i.state={filteredOptions:t.options,allOptions:t.options,selected:n,opened:!!t.alwaysOpened},i.mounted=!0,i}return(0,r.__extends)(t,e),t.prototype.getLabel=function(e){return this.props.searchable?this.props.value||"":e.placeholder||"Select..."},t.prototype.UNSAFE_componentWillReceiveProps=function(e){this.setState({filteredOptions:e.options,allOptions:e.options}),this.props.editable&&void 0!==e.customValue?this.setState({selected:{label:e.customValue,value:e.customValue}}):void 0!==e.value&&e.value!==this.state.selected?this.setState({selected:this.getOptionByValue(e.options,e.value)}):void 0===e.value&&this.setState({selected:{label:this.getLabel(e),value:""}})},t.prototype.componentDidMount=function(){this.el=i.findDOMNode(this),document.addEventListener("mousedown",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,!1)},t.prototype.componentWillUnmount=function(){this.mounted=!1,document.removeEventListener("mousedown",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,!1)},t.prototype.toggle=function(e){var t=this;this.setState({opened:e},(function(){var e,n,r,o;t.state.opened?null===(n=(e=t.props).onShow)||void 0===n||n.call(e):null===(o=(r=t.props).onHide)||void 0===o||o.call(r)}))},t.prototype.render=function(){var e=this.props,t=e.className,n=e.appearance,r=e.style,i=e.searchable,s=e.editable,c=e.disabled,l=e.position,u=e.isFluid,d=e.alwaysNotEmpty,_=this.state,p=_.selected,h=_.opened,f=!d&&p&&"object"==typeof p&&!p.value||!1,m=i||s?"secondary":n,g=(0,a.classNames)("Select","Select--"+m,"Select--"+l,{"Select--opened":!!h,"Select--disabled":!!c,"Select--empty":f,"Select--isFluid":u},t),v=this.buildControl(p);return o.createElement("div",{className:g,style:r},v,this.state.opened&&this.renderMenu())},t.defaultProps={appearance:"primary",searchPlaceholder:"No options found",searchable:!1,editable:!1,inputOtherProps:{},onShow:function(){},onHide:function(){},position:"b"},t}(o.Component)},41388:(e,t,n)=>{"use strict";n.d(t,{default:()=>a});var r=n(70655),o=n(67294),i=n(59397);const a=function(e){function t(t){var n=e.call(this,t)||this;return n.getActiveTabKey=function(){var e=n.props,t=e.active,r=e.activeRequired,i=[],a=null;return o.Children.forEach(n.props.children,(function(e){o.isValidElement(e)&&(e.key===t?a=e.key:i.push(e))})),a||("number"==typeof t&&i.length>t?i[t].key||t:r&&i.length?i[0].key||0:null)},n.onClick=function(e,t){if(t!==n.state.active){var r=n.refsStore[t],o=n.getTransform(r);n.setState({active:t,isAnimating:!0,transform:o}),n.props.onTabClick&&n.props.onTabClick(e,t)}},n.onTransitionEnd=function(e){"transform"===e.propertyName&&n.setState({isAnimating:!1})},n.storeRef=function(e,t){t&&(n.refsStore[e]=t)},n.refsStore={},n.state={isAnimating:!1,active:n.getActiveTabKey()},n}return(0,r.__extends)(t,e),t.reactifyTabs=function(e){return(Array.isArray(e)?e:Object.values(e)).map((function(e){return o.createElement("a",{key:e[0],href:e[2],onClick:function(){}},e[1]?e[1]:"")}))},t.prototype.componentDidUpdate=function(e){void 0!==this.props.active&&this.props.active!==e.active&&this.setState({active:this.props.active})},t.prototype.getTransform=function(e){var t=e.offsetWidth;return"translateX("+(e.offsetLeft-50+.5*t)+"px) scaleX("+t/100+")"},t.prototype.componentDidMount=function(){if(this.state.active){var e=this.refsStore[this.state.active];this.setState({transform:this.getTransform(e)})}},t.prototype.render=function(){var e=this,t={"Tabs--animating":this.state.isAnimating};return o.createElement("nav",{className:(0,i.classNames)("Tabs",this.props.className,t),style:this.props.style},o.createElement("ul",{className:"Tabs__list"},o.Children.map(this.props.children,(function(t,n){var r;if(!o.isValidElement(t))return null;var a=t.key||n;return o.createElement("li",{className:(0,i.classNames)("Tabs__item",{"Tabs__item--active":e.state.active===a,"Tabs__item--disabled":null===(r=e.props.disabledTabMap)||void 0===r?void 0:r[a]}),onClick:function(t){return e.onClick(t,a)},ref:function(t){return e.storeRef(a,t)},key:a},t)}))),this.props.aside&&o.createElement("div",{className:"Tabs__aside"},this.props.aside),o.createElement("div",{style:{transform:this.state.transform},className:"Tabs__divider",onTransitionEnd:this.onTransitionEnd}))},t.defaultProps={active:0,activeRequired:!0,aside:null,style:{},className:""},t}(o.Component)},94021:(e,t,n)=>{"use strict";n.d(t,{WithPortal:()=>s});var r=n(70655),o=n(67294),i=n(73935),a=function(){return document.createElement("div")},s=(0,o.forwardRef)((function(e,t){var n=e.children,s=e.portalContainerParent,c=void 0===s?document.body:s,l=e.renderNodeFactory,u=void 0===l?a:l,d=(0,r.__rest)(e,["children","portalContainerParent","renderNodeFactory"]),_=(0,o.useRef)(null);return _.current||(_.current=u(),c.appendChild(_.current)),(0,o.useEffect)((function(){return function(){_.current&&_.current.remove()}}),[]),i.createPortal(o.createElement("div",(0,r.__assign)({},d,{ref:t}),n),_.current)}))},30810:(e,t,n)=>{"use strict";n.d(t,{useCombinedRefs:()=>o});var r=n(67294);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.useRef)(null);return r.useEffect((function(){e.forEach((function(e){null!==e&&null!==n&&(e.current=n.current)}))}),[e]),n}},70655:(e,t,n)=>{"use strict";n.d(t,{__extends:()=>o,__assign:()=>i,__rest:()=>a,__awaiter:()=>s,__generator:()=>c,__values:()=>l,__read:()=>u,__spreadArray:()=>d});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function s(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||t)}Object.create},45580:(e,t,n)=>{"use strict";n.d(t,{default:()=>r});const r=(0,n(40447).adapterFactory)({window:"undefined"==typeof window?void 0:window})},40447:(e,t,n)=>{"use strict";n.d(t,{adapterFactory:()=>u});var r=n(86643),o=n(65070),i=n(24854),a=n(60057),s=n(9080),c=n(55938),l=n(48864);function u({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=r.log,u=r.detectBrowser(e),d={browserDetails:u,commonShim:l,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(u.browser){case"chrome":if(!o||!o.shimPeerConnection||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),d;if(null===u.version)return n("Chrome shim can not determine version, not shimming."),d;n("adapter.js shimming chrome."),d.browserShim=o,o.shimGetUserMedia(e),o.shimMediaStream(e),o.shimPeerConnection(e),o.shimOnTrack(e),o.shimAddTrackRemoveTrack(e),o.shimGetSendersWithDtmf(e),o.shimGetStats(e),o.shimSenderReceiverGetStats(e),o.fixNegotiationNeeded(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;case"firefox":if(!a||!a.shimPeerConnection||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),d;n("adapter.js shimming firefox."),d.browserShim=a,s.shimGetUserMedia(e),a.shimPeerConnection(e),a.shimOnTrack(e),a.shimRemoveStream(e),a.shimSenderGetStats(e),a.shimReceiverGetStats(e),a.shimRTCDataChannel(e),a.shimAddTransceiver(e),a.shimGetParameters(e),a.shimCreateOffer(e),a.shimCreateAnswer(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"edge":if(!i||!i.shimPeerConnection||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),d;n("adapter.js shimming edge."),d.browserShim=i,i.shimGetUserMedia(e),i.shimGetDisplayMedia(e),i.shimPeerConnection(e),i.shimReplaceTrack(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"safari":if(!c||!t.shimSafari)return n("Safari shim is not included in this adapter release."),d;n("adapter.js shimming safari."),d.browserShim=c,c.shimRTCIceServerUrls(e),c.shimCreateOfferLegacy(e),c.shimCallbacksAPI(e),c.shimLocalStreamsAPI(e),c.shimRemoteStreamsAPI(e),c.shimTrackEventTransceiver(e),c.shimGetUserMedia(e),c.shimAudioContext(e),l.shimRTCIceCandidate(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;default:n("Unsupported browser!")}return d}},65070:(e,t,n)=>{"use strict";n.r(t),n.d(t,{shimGetUserMedia:()=>o.shimGetUserMedia,shimGetDisplayMedia:()=>i.shimGetDisplayMedia,shimMediaStream:()=>a,shimOnTrack:()=>s,shimGetSendersWithDtmf:()=>c,shimGetStats:()=>l,shimSenderReceiverGetStats:()=>u,shimAddTrackRemoveTrackWithNative:()=>d,shimAddTrackRemoveTrack:()=>_,shimPeerConnection:()=>p,fixNegotiationNeeded:()=>h});var r=n(86643),o=n(80009),i=n(71533);function a(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function s(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const o=new Event("track");o.track=n.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)})),t.stream.getTracks().forEach((n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else r.wrapPeerConnectionEvent(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function c(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function l(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const o=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},i=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const r=function(e){n(i(o(e)))};return t.apply(this,[r,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(i(o(t)))},n])})).then(n,r)}}function u(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>r.filterStats(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),r.wrapPeerConnectionEvent(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>r.filterStats(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach((n=>{n.track===e&&(t?r=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?r=!0:n=t),t.track===e))),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function d(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),o.apply(this,arguments)}}function _(e){if(!e.RTCPeerConnection)return;const t=r.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return d(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}o.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function s(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");const o=this.getSenders().find((e=>e.track===t));if(o)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>a(this,e)))}};e.RTCPeerConnection.prototype[t]=r[t]}));const c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),c.apply(this,arguments)):c.apply(this,arguments)};const l=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=l.get.apply(this);return""===e.type?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function p(e){const t=r.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),!e.RTCPeerConnection)return;const n=0===e.RTCPeerConnection.prototype.addIceCandidate.length;t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const o=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return n||arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():o.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}function h(e){const t=r.detectBrowser(e);r.wrapPeerConnectionEvent(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}},71533:(e,t,n)=>{"use strict";function r(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}n.d(t,{shimGetDisplayMedia:()=>r})},80009:(e,t,n)=>{"use strict";n.d(t,{shimGetUserMedia:()=>i});var r=n(86643);const o=r.log;function i(e){const t=e&&e.navigator;if(!t.mediaDevices)return;const n=r.detectBrowser(e),i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[o("min",n)]=r.ideal,t.optional.push(e),e={},e[o("max",n)]=r.ideal,t.optional.push(e)):(e[o("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach((e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,r){if(n.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let a=e.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});const s=n.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||s)){let n;if(delete e.video.facingMode,"environment"===a.exact||"environment"===a.ideal?n=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(n=["front"]),n)return t.mediaDevices.enumerateDevices().then((t=>{let s=(t=t.filter((e=>"videoinput"===e.kind))).find((e=>n.some((t=>e.label.toLowerCase().includes(t)))));return!s&&t.length&&n.includes("back")&&(s=t[t.length-1]),s&&(e.video.deviceId=a.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=i(e.video),o("chrome: "+JSON.stringify(e)),r(e)}))}e.video=i(e.video)}return o("chrome: "+JSON.stringify(e)),r(e)},s=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){a(e,(e=>{t.webkitGetUserMedia(e,n,(e=>{r&&r(s(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){const e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(t){return a(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(s(e))))))}}}},48864:(e,t,n)=>{"use strict";n.r(t),n.d(t,{shimRTCIceCandidate:()=>a,shimMaxMessageSize:()=>s,shimSendThrowTypeError:()=>c,shimConnectionState:()=>l,removeAllowExtmapMixed:()=>u});var r=n(57539),o=n.n(r),i=n(86643);function a(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),r=o().parseCandidate(e.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,i.wrapPeerConnectionEvent(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function s(e){if(!e.RTCPeerConnection)return;const t=i.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=o().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=o().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},a=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},s=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=o().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=r(arguments[0]),t=a(e),n=s(arguments[0],e);let o;o=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const i={};Object.defineProperty(i,"maxMessageSize",{get:()=>o}),this._sctp=i}return c.apply(this,arguments)}}function c(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},i.wrapPeerConnectionEvent(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function l(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function u(e){if(!e.RTCPeerConnection)return;const t=i.detectBrowser(e);if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n")),n.apply(this,arguments)}}},24854:(e,t,n)=>{"use strict";n.r(t),n.d(t,{shimGetUserMedia:()=>s.shimGetUserMedia,shimGetDisplayMedia:()=>c.shimGetDisplayMedia,shimPeerConnection:()=>l,shimReplaceTrack:()=>u});var r=n(86643),o=n(60641),i=n(62539),a=n.n(i),s=n(31169),c=n(94155);function l(e){const t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=a()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,o.filterIceServers)(e.iceServers,t.version),r.log("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function u(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}},60641:(e,t,n)=>{"use strict";n.d(t,{filterIceServers:()=>o});var r=n(86643);function o(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");const o="string"==typeof t;return o&&(t=[t]),t=t.filter((e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=o?t[0]:t,!!t.length}}))}},94155:(e,t,n)=>{"use strict";function r(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}n.d(t,{shimGetDisplayMedia:()=>r})},31169:(e,t,n)=>{"use strict";function r(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch((e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e))))}}n.d(t,{shimGetUserMedia:()=>r})},60057:(e,t,n)=>{"use strict";n.r(t),n.d(t,{shimGetUserMedia:()=>o.shimGetUserMedia,shimGetDisplayMedia:()=>i.shimGetDisplayMedia,shimOnTrack:()=>a,shimPeerConnection:()=>s,shimSenderGetStats:()=>c,shimReceiverGetStats:()=>l,shimRemoveStream:()=>u,shimRTCDataChannel:()=>d,shimAddTransceiver:()=>_,shimGetParameters:()=>p,shimCreateOffer:()=>h,shimCreateAnswer:()=>f});var r=n(86643),o=n(9080),i=n(72365);function a(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function s(e){const t=r.detectBrowser(e);if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})),t.version<68){const t=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,i]=arguments;return o.apply(this,[e||null]).then((e=>{if(t.version<53&&!r)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(r,i)}}function c(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function l(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),r.wrapPeerConnectionEvent(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function u(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function d(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function _(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})}function p(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function h(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function f(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}},72365:(e,t,n)=>{"use strict";function r(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}n.d(t,{shimGetDisplayMedia:()=>r})},9080:(e,t,n)=>{"use strict";n.d(t,{shimGetUserMedia:()=>o});var r=n(86643);function o(e){const t=r.detectBrowser(e),n=e&&e.navigator,o=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,o){r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,o)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},o&&o.prototype.getSettings){const t=o.prototype.getSettings;o.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(o&&o.prototype.applyConstraints){const t=o.prototype.applyConstraints;o.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}},55938:(e,t,n)=>{"use strict";n.r(t),n.d(t,{shimLocalStreamsAPI:()=>o,shimRemoteStreamsAPI:()=>i,shimCallbacksAPI:()=>a,shimGetUserMedia:()=>s,shimConstraints:()=>c,shimRTCIceServerUrls:()=>l,shimTrackEventTransceiver:()=>u,shimCreateOfferLegacy:()=>d,shimAudioContext:()=>_});var r=n(86643);function o(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function i(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function a(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,i=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o};let s=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function s(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(c(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function c(e){return e&&void 0!==e.video?Object.assign({},e,{video:r.compactObject(e.video)}):e}function l(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let o=e.iceServers[n];!o.hasOwnProperty("urls")&&o.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,t.push(o)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function u(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function d(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}function _(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}},86643:(e,t,n)=>{"use strict";n.d(t,{extractVersion:()=>i,wrapPeerConnectionEvent:()=>a,disableLog:()=>s,disableWarnings:()=>c,log:()=>l,deprecated:()=>u,detectBrowser:()=>d,compactObject:()=>p,filterStats:()=>f});let r=!0,o=!0;function i(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function a(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);const i=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,i),o.apply(this,[e,i])};const i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(n))return i.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,i.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function s(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function c(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(o=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function l(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function u(e,t){o&&console.warn(e+" is deprecated, please use "+t+" instead.")}function d(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=i(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=i(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.mediaDevices&&n.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=i(n.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=i(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}function _(e){return"[object Object]"===Object.prototype.toString.call(e)}function p(e){return _(e)?Object.keys(e).reduce((function(t,n){const r=_(e[n]),o=r?p(e[n]):e[n],i=r&&!Object.keys(o).length;return void 0===o||i?t:Object.assign(t,{[n]:o})}),{}):e}function h(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((r=>{r.endsWith("Id")?h(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((t=>{h(e,e.get(t),n)}))})))}function f(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;const i=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((t=>{e.forEach((n=>{n.type===r&&n.trackId===t.id&&h(e,n,o)}))})),o}},94795:function(e,t,n){var r;!function(t){"use strict";function o(){}var i=o.prototype,a=t.EventEmitter;function s(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function c(e){return function(){return this[e].apply(this,arguments)}}function l(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&l(e.listener)}i.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},i.addListener=function(e,t){if(!l(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===s(r[n],t)&&r[n].push(o?t:{listener:t,once:!1});return this},i.on=c("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=c("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&-1!==(n=s(o[r],t))&&o[r].splice(n,1);return this},i.off=c("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var r,o,i=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)i.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(o=t[r])&&("function"==typeof o?i.call(this,r,o):a.call(this,r,o));return this},i.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},i.removeAllListeners=c("removeEvent"),i.emitEvent=function(e,t){var n,r,o,i,a=this.getListenersAsObject(e);for(i in a)if(a.hasOwnProperty(i))for(n=a[i].slice(0),o=0;o<n.length;o++)!0===(r=n[o]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},i.trigger=c("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},o.noConflict=function(){return t.EventEmitter=a,o},void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}("undefined"!=typeof window?window:this||{})}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";var core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(21466),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(51876),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(59357),_web_stories_narrative_utils__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(52745),_web_articles_article_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(49140),_web_evbus__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(73009);(0,_web_evbus__WEBPACK_IMPORTED_MODULE_5__.init)(),window.WComments={init:function(e){e.reply_names&&isArray(e.reply_names)&&(e.reply_names={}),extend(cur,{options:e,oid:e.user_id,postTo:e.user_id,heightEl:geByClass1("_wcomments_page"),countEl:geByClass1("_wcomments_count"),contentEl:geByClass1("_wcomments_content"),section:e.section,noAwayCheck:!0,sendPostBtn:ge("send_post"),postsEl:ge("wcomments_posts"),postsOuterEl:geByClass1("_wcomments_posts_outer"),wallType:"widget_comments",onReplyFormSizeUpdate:WComments.contentUpdated.bind(WComments,!1),onEditFormSizeUpdate:WComments.contentUpdated.bind(WComments,!1)}),cur.options.filter_media_types=cur.options.media_types||[],this.override("lite.js"),this.override("page.js"),this.override(jsc("web/emoji.js")),stManager.emitter.addListener("update",this.override.bind(this)),this.updateSize(),(e.is_auto||e.is_nano)&&extend(e,{media_opts:{hideAfterCount:0,maxShown:0}}),Wall.init(e),e.fixed_height?(setStyle(cur.postsOuterEl,{maxHeight:e.fixed_height-getSize(geByClass1("_wcomments_head"))[1]-getSize(geByClass1("_wcomments_form"))[1]}),cur.scrollbar=new uiScroll(cur.postsOuterEl,{hidden:1,onmore:this.showMore.bind(this),ondragstart:function(){cur.Rpc.callMethod("startDrag")},ondragstop:function(){cur.Rpc.callMethod("stopDrag")}}),cur.mouseMove=cur.scrollbar.ondrag.bind(cur.scrollbar),cur.mouseUp=cur.scrollbar.ondragstop.bind(cur.scrollbar)):(cur.mouseMove=function(){},cur.mouseUp=function(){}),e.qtransport&&this.initQTransport(e.qtransport),window.timeUpdateInt=setInterval(this.updateTimes.bind(this),1e4),cur.RpcMethods={onInit:function(){var e=this.resizeWidget.bind(this);setTimeout(e,0),setTimeout(e,500)}.bind(this),updateStickers:function(){window.emojiStickers=!1,window.Emoji&&Emoji.updateTabs()},mouseMove:cur.mouseMove,mouseUp:cur.mouseUp,chooseMedia:function(){var e=cleanObj(this.uncleanObj([].slice.call(arguments)));cur.chooseMedia.apply(cur.chooseMedia,e),setTimeout(this.resizeWidget.bind(this),0)}.bind(this),addMedia:function(e,t){var n=["pollBackgroundUploaded"];if(~n.indexOf(t)&&cur.addMedia&&cur.addMedia[e]&&isFunction(cur.addMedia[e][t])){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];cur.addMedia[e][t].apply(cur.addMedia[e],o)}},showMediaProgress:function(){var e=cleanObj([].slice.call(arguments));cur.showMediaProgress.apply(cur.showMediaProgress,e)},likeFullUpdate:function(){}};try{cur.Rpc=new fastXDM.Client(cur.RpcMethods,{safe:!0,sameOrigin:!0,unsafeMethods:["mouseMove","mouseUp"]}),cur.resizeInt=setInterval(this.resizeWidget.bind(this),1e3)}catch(e){debugLog(e)}e.user_id||(addEvent("send_post","click",Widgets.oauth.bind(Widgets)),addEvent("post_field","click",Widgets.oauth.bind(Widgets)))},uncleanObj:function(e){if(isObject(e)){var t={};for(var n in e)t[n.replace(/[^a-zA-Z0-9_\-]/g,"")]=this.uncleanObj(e[n])}else if(isArray(e)){t=[];for(var n in e)t.push(this.uncleanObj(e[n]))}else{var r=typeof e;if("number"==r||"boolean"==r||"function"==r)t=e;else t=unclean(e)}return t},getSectionParams:function(){var e={app:cur.options.app,width:cur.options.width,startWidth:cur.options.startWidth,limit:cur.options.limit};switch(cur.section){case"admin_browse":e.act="admin_browse";break;case"admin_bl":e.act="admin_bl",e.limit=15;break;case"admin_updates":e.act="admin_updates";break;case"browse":e.browse=1,e.replies=cur.options.replies;break;default:e.page_query=cur.options.page_query,e.part=1}return e},contentUpdated:function(e){e&&this.applyOptions(e),this.resizeWidget()},applyOptions:function applyOptions(options){options.reply_names&&(isArray(options.reply_names)&&(options.reply_names={}),cur.options.reply_names=extend(cur.options.reply_names||{},options.reply_names),delete options.reply_names),options.head_count&&"browse"!=cur.section&&(val(geByClass1("_wcomments_count"),options.head_count),delete options.head_count),options.script&&(eval(options.script),delete options.script),extend(cur.options,options),toggle(geByClass1("_wcomments_more"),options.offset<options.count)},updateSize:function e(t){var n=(t||getSize("page_wrap"))[0];if(setStyle(cur.heightEl,{width:n}),cur.options.is_auto){var r=1==cur.options.mini||0!=cur.options.mini&&n<630,o=r&&n<380;e.size!=r+""+o&&(e.size=r+""+o,replaceClass(bodyNode,"wcomments_mini wcomments_nano",(r?"wcomments_mini ":"")+(o?"wcomments_nano ":"")))}},resizeWidget:function e(){if(cur.heightEl&&cur.Rpc){var t=getSize("page_wrap");(browser.msie&&!browser.msie8||browser.opera)&&(t[1]+=15),window.onBodyResize&&onBodyResize(),e.size!=t.join(" ")&&(e.size=t.join(" "),this.updateSize(t),cur.Rpc.callMethod("resize",t[1]))}},showMore:function(){if(!cur.switchingSection){var e=geByClass1("_wcomments_more");if(cur.options.offset>=cur.options.count)return hide(e);buttonLocked(e)||ajax.post("al_widget_comments.php",extend(WComments.getSectionParams(),{offset:cur.options.offset,width:cur.options.width,startWidth:cur.options.startWidth,part:1}),{onDone:function(e,t){ge("wcomments_posts").appendChild(cf(t)),WComments.contentUpdated(e)},showProgress:lockButton.pbind(e),hideProgress:unlockButton.pbind(e)})}},switchSection:function(e){if(cur.switchingSection||cur.section==e)return!1;cur.switchingSection=!0;var t=uiTabs&&geByClass1("_wcomments_admin_tabs"),n=t&&geByClass1("_"+e);return"posts"==e||"posts"==cur.section?addClass(cur.contentEl,"wcomments_content_loading"):t&&uiTabs.showProgress(t),n&&uiTabs.switchTab(geByClass1("ui_tab",n)),cur.section=e,ajax.post("al_widget_comments.php",WComments.getSectionParams(),{onDone:function(n,r){val(cur.postsEl,r),t&&uiTabs.hideProgress(t),removeClass(cur.contentEl,"wcomments_content_loading"),replaceClass(cur.heightEl,"wcomments_section_posts wcomments_section_admin_browse wcomments_section_admin_bl wcomments_section_admin_updates wcomments_section_browse","wcomments_section_"+e),cur.options.fixed_height&&setStyle(cur.postsOuterEl,{maxHeight:cur.options.fixed_height-getSize(geByClass1("_wcomments_head"))[1]-getSize("posts"==cur.section||"browse"==cur.section?geByClass1("_wcomments_form"):geByClass1("_wcomments_admin_tabs"))[1]}),cur.scrollbar&&cur.scrollbar.scrollTop(),WComments.contentUpdated(n),cur.switchingSection=!1}}),!1},addToBl:function(e,t,n){if(hasClass(n,"wcomments_bl_action_loading"))return!1;ajax.post("al_widget_comments.php",{act:"a_add_to_bl",id:e,hash:t,app:cur.options.app},{onDone:function(){hide(geByClass1("_wcomments_bl_label_"+e)),n.onclick=WComments.delFromBl.bind(WComments,e,t,n),val(n,getLang("widgets_remove_from_banlist"))},showProgress:addClass.pbind(n,"wcomments_bl_action_loading"),hideProgress:removeClass.pbind(n,"wcomments_bl_action_loading")})},delFromBl:function(e,t,n){if(hasClass(n,"wcomments_bl_action_loading"))return!1;ajax.post("al_widget_comments.php",{act:"a_del_from_bl",id:e,hash:t,app:cur.options.app},{onDone:function(){setStyle(geByClass1("_wcomments_bl_label_"+e),"display","inline"),n.onclick=WComments.addToBl.bind(WComments,e,t,n),val(n,getLang("widgets_restore_to_banlist"))},showProgress:addClass.pbind(n,"wcomments_bl_action_loading"),hideProgress:removeClass.pbind(n,"wcomments_bl_action_loading")})},updateTimes:function(e){if((cur.lang||{}).wall_X_seconds_ago_words){var t=intval(vkNow()/1e3),n=[];t-=cur.tsDiff,each(geByClass("rel_date_needs_update",e||ge("wcomments_posts"),"span"),(function(e,r){if(r){var o=intval(r.getAttribute("time")),i=t-o,a=r.getAttribute("abs_time");i<5?a=getLang("wall_just_now"):i<60?a=Wall.langWordNumeric(i,cur.lang.wall_X_seconds_ago_words,cur.lang.wall_X_seconds_ago):i<3600?a=Wall.langWordNumeric(intval(i/60),cur.lang.wall_X_minutes_ago_words,cur.lang.wall_X_minutes_ago):i<14400?a=Wall.langWordNumeric(intval(i/3600),cur.lang.wall_X_hours_ago_words,cur.lang.wall_X_hours_ago):n.push(r),r.innerHTML=a}})),each(n,(function(){removeClass(this,"rel_date_needs_update")}))}},langWordNumeric:function(e,t,n){return isArray(t)&&e<t.length?t[e]:langNumeric(e,n)},showLikesBox:function(e,t){showBox("widget_like.php",extend({act:"a_stats_box",app:cur.options.app,obj:e,from:"wcomments",check_hash:cur.likeCheckHash,widget_width:638},t||{}))},deleteAllAndBan:function(e,t,n,r){ajax.post("al_widget_comments.php",{act:"a_add_to_bl",id:t,hash:n,app:cur.options.app},{onDone:function(n,r){r&&each(geByClass("wcomments_post",ge("wcomments_posts"),"div"),(function(){!this.id.indexOf("post"+t)&&this.id.split("_")[1]>=r&&this.id!="post"+e&&isVisible(this)&&hide(this)})),ge("post_del"+e).innerHTML=n,WComments.contentUpdated()},showProgress:function(){lockButton(r)},hideProgress:function(){unlockButton(r)}})},initQTransport:function(e){window.curNotifier=extend(e,{lp_connected:!1,error_timeout:1,addQueues:{},recvClbks:{},recvData:{},onConnectionId:[]}),WComments.lpInit(),WComments.lpStart()},lpGetTransportWrap:function(){var e=ge("queue_transport_wrap");return e||(e=ce("div",{id:"queue_transport_wrap"}),utilsNode.appendChild(e)),e},lpInit:function(){curNotifier.lpMakeRequest||(delete curNotifier.lpMakeRequest,re("queue_transport_frame"),WComments.lpGetTransportWrap().appendChild(ce("iframe",{id:"queue_transport_frame",name:"queue_transport_frame",src:curNotifier.frame_path})))},lpStart:function(){curNotifier.lp_started=!0,WComments.lpCheck()},lpStop:function(){curNotifier.lp_started=!1,clearTimeout(curNotifier.lp_check_to),clearTimeout(curNotifier.lp_error_to)},lpCheck:function lpCheck(){curNotifier.lp_started&&(curNotifier.lpMakeRequest?curNotifier.lpMakeRequest(curNotifier.frame_url,{act:"a_check",ts:curNotifier.timestamp,key:curNotifier.key,id:curNotifier.uid,wait:25},function(text){if(curNotifier.lp_started)try{var success=this.lpChecked(eval("("+text+")"));success&&(this.lpCheck(),curNotifier.error_timeout=1)}catch(e){topError("Notify error: "+e.message),curNotifier.lp_error_to=setTimeout(this.lpCheck.bind(this),1e3*curNotifier.error_timeout),curNotifier.error_timeout<64&&(curNotifier.error_timeout*=2)}}.bind(this),function(e){curNotifier.lp_error_to=setTimeout(this.lpCheck.bind(this),1e3*curNotifier.error_timeout),curNotifier.error_timeout<64&&(curNotifier.error_timeout*=2)}.bind(this)):curNotifier.lp_check_to=setTimeout(this.lpCheck.bind(this),1e3))},lpChecked:function(e){var t=e.failed;if(2==t)return curNotifier.lp_error_to=setTimeout(this.lpGetKey.bind(this),1e3*curNotifier.error_timeout),curNotifier.error_timeout<64&&(curNotifier.error_timeout*=2),!1;if(t)throw new Error(getLang("global_unknown_error"));return curNotifier.timestamp=e.ts,!cur.section.indexOf("admin")||(cur.saveScrollPosition=cur.scrollbar&&cur.scrollbar.data.scrollTop>100,each(e.events,(function(e,t){WComments.eventsParse(t)})),!0)},lpGetKey:function(){vkNow();ajax.post("al_widget_comments.php",{act:"a_get_key",id:curNotifier.uid,app:cur.options.app,page_query:cur.options.page_query},{onDone:function(e,t){curNotifier.timestamp=t,curNotifier.key=e,this.lpCheck()}.bind(this),onFail:function(e){if(3!=e)return curNotifier.error_timeout=64,this.lp_error_to=setTimeout(this.lpGetKey.bind(this),1e3*curNotifier.error_timeout),curNotifier.error_timeout<64&&(curNotifier.error_timeout*=2),!0;location.reload()}.bind(this)})},resizePostSizedThumbs:function(e,t,n,r,o){var i=geByClass("page_post_thumb_wrap",e),a=[],s=0,c=0,l=function(){d&&a.push(d),s=c=0,extend(this,{tiles:[],height:0,x:0,y:0})},u=function(e){e&&extend(this,{el:e,lastRow:hasClass(e,"page_post_thumb_last_row"),lastColumn:hasClass(e,"page_post_thumb_last_column"),width:intval(e.style.width),height:intval(e.style.height)})},d=new l,_=positive(e.style.width),p=positive(e.style.height),h=0;if(t>_&&(t=null),(r>p||o&&i.length>1)&&(r=null),!r&&t)r=Math.round(p*(t/_));else if(r&&!t)t=Math.round(_*(r/p));else{if(!t||!r)return;o&&(r=Math.min(r,Math.round(p*(t/_))),t=Math.round(_*(r/p)))}return each(i,(function(e,t){var r=t.tile||new u(t),o=new u(i[e+1]);d.height=Math.max(d.height,r.height),_-s>=r.width/2?(s+=r.width+(r.lastColumn?0:n),c=r.height,r.x=d.x,r.y=d.y=0,d.tiles.push(r),r.lastColumn?o&&o.lastColumn&&d.height-c>=o.height/2||(d=new l):d.x++):r.lastColumn&&d.height-c>=r.height/2&&(c+=r.height+n,r.x=d.x,r.y=++d.y,d.tiles.push(r),!r.lastRow&&o&&o.lastColumn&&d.height-c>=o.height/2||(d.height=Math.max(d.height,c),d=new l))})),each(a,(function(e,o){var i=0,s=0,c=(t-n*o.x)/(_-n*o.x),l=(r-n*o.y)/(p-n*o.y),u=a.length-1==e?r-h:Math.round(o.height*l),d=0,f=0;h+=u+n,each(o.tiles,(function(e,r){r.x<o.x?(d=Math.round(r.width*c),i+=d+n,r.y||(f=u)):r.lastColumn&&(d=t-i,r.y==o.y?f=u-s:(f=Math.round(r.height*l),s+=f+n)),setStyle(r.el,{width:d,height:f})}))})),setStyle(e,{width:t,height:r}),[t,r]},resizePostAlbumWrap:function(e,t,n,r){r||(r="");var o=positive(e.style.width),i=geByClass1("page"+r+"_album_thumb_wrap",e,"div"),a=domFC(geByClass1("page"+r+"_album_photos",e,"div")),s=domFC(geByClass1("page"+r+"_album_under_row",e,"div"));if(scaleX=t/o,!(o<t)&&i){setStyle(e,{width:t});var c=Math.round(positive(i.style.width)*scaleX),l=Math.round(positive(i.style.height)*scaleX);setStyle(i,{width:c,height:l}),a&&WComments.resizePostSizedThumbs(a,t-n-c,n,l),s&&WComments.resizePostSizedThumbs(s,t,n,positive(s.style.height)*((t-n)/(o-n)))}},resizePost:function(e,t){var n=t?cur.options.reply_max_w:cur.options.max_w,r=Math.max(cur.options.kludges_min_h,n*(t?cur.options.reply_kludges_ratio:cur.options.kludges_ratio));return each(geByClass("page_album_wrap",e,"div"),(function(e,t){WComments.resizePostAlbumWrap(t,n,5)})),each(geByClass("page_market_album_wrap",e,"div"),(function(e,t){WComments.resizePostAlbumWrap(t,n-2,2,"_market")})),each(geByClass("page_post_sized_thumbs",e,"div"),(function(e,t){WComments.resizePostSizedThumbs(t,n,5,r,!0)})),each(geByClass("audio_pl_snippet",e,"div"),(function(e,t){if(n<=cur.playlist_snippet_max_narrow_width)var r="audio_pl_snippet_size_narrow";else if(n<=cur.playlist_snippet_max_medium_width)r="audio_pl_snippet_size_medium";else r="";setStyle(t,"width",n),removeClass(t,"audio_pl_snippet_size_narrow"),removeClass(t,"audio_pl_snippet_size_medium"),r&&addClass(t,r)})),e},eventsQueue:[],eventsPaused:!1,eventsPause:function(){this.eventsPaused=!0},eventsProceed:function(){for(this.eventsPaused=!1;this.eventsQueue.length;)this.eventsParse(this.eventsQueue.shift())},eventsUpdateAttaches:function(e){each(geByClass("audio_row",e,"div"),(function(e,t){addClass(t,"audio_no_actions")}))},eventsParse:function(e){if(this.eventsPaused)return this.eventsQueue.push(e);if(isObject(e))return Wall.processQueueEvent(e);var t=e.split("<!>"),n=t[0],r=t[1],o=t[2],i=ge("post"+o);if(n!=cur.options.qversion)return location.reload();switch(r){case"new_post":if(i)break;var a=ge("wcomments_posts"),s=(intval(t[t.length-1]),this.resizePost(se(Wall.getNewPostHTML(t,cur.options.is_admin))));function e(){a.insertBefore(s,a.firstChild),(0,_web_stories_narrative_utils__WEBPACK_IMPORTED_MODULE_3__.updateNarrativeSnippetsFromQueueByPost)(s),(0,_web_articles_article_utils__WEBPACK_IMPORTED_MODULE_4__.updateArticleSnippetsFromQueueByPost)(s)}WComments.eventsUpdateAttaches(s),cur.saveScrollPosition?cur.scrollbar.updateAbove(e):(e(),cur.scrollbar&&cur.scrollbar.scrollTop(0,!0)),nodeUpdated(s),Wall.updateMentionsIndex(),"browse"!==cur.section&&val(cur.countEl,d?getLang("widgets_comments_top_count",d):getLang("widgets_comments"));break;case"del_post":i&&(!cur.wallMyDeleted[o]&&hide(i),cur.options.offset--);break;case"res_post":i&&cur.options.offset++;break;case"new_reply":if(!i||cur.wallMyReplied[o]||ge("post"+t[3]))break;var c=ge("replies"+o),l=(s=this.resizePost(se(Wall.getNewReplyHTML(t,cur.options.is_admin)),!0),!1);if(isVisible("reply_link"+o))re("reply_link"+o),show("replies_wrap"+o),l=!0;else{var u=c.nextSibling,d=geByClass("new_reply",c,"div").length+1;if(cur.wallMyOpened[o]){u&&"replies_open"==u.className&&re(u),l=!0;var _=geByClass1("wr_header",c,"a"),p=geByClass("reply",c,"div").length+1,h=p;_&&(h=intval(_.getAttribute("offs").split("/")[1])+1),(h>5||p<h)&&(_||(_=ce("a",{className:"wr_header"}),c.insertBefore(_,c.firstChild)),Wall.updateRepliesHeader(o,_,p,h))}else addClass(s,"new_reply"),u&&"replies_open"==u.className||(u=ce("div",{className:"replies_open",onclick:Wall.openNewComments.pbind(o)}),c.parentNode.insertBefore(u,c.nextSibling)),val(u,getLang("news_x_new_replies_more",Math.min(100,d))),u.newCnt=d}(0,_web_stories_narrative_utils__WEBPACK_IMPORTED_MODULE_3__.updateNarrativeSnippetsFromQueueByPost)(s),(0,_web_articles_article_utils__WEBPACK_IMPORTED_MODULE_4__.updateArticleSnippetsFromQueueByPost)(s),WComments.eventsUpdateAttaches(s),c.appendChild(s),l&&nodeUpdated(s);break;case"del_reply":!cur.wallMyDeleted[o]&&re(i)}this.resizeWidget()},override:function(e,t){var n,r;if(StaticFiles[e]||!0===t)switch(e){case"lite.js":extend(window,{showTooltip:Widgets.showTooltip,showBox:Widgets.showBox({"al_photos.php":{photo_box:!0,choose_photo:!0},"al_video.php":{video_box:!0,a_choose_video_box:!0},"al_places.php":{show_photo_place:!0},"like.php":{publish_box:!0},"widget_like.php":{a_stats_box:!0},"al_wall.php":{canvas_draw_box:!0},"al_im.php":{stickers_store:!0,sticker_preview:!0},"al_audio.php":{choose_box:!0},"al_page.php":{owner_photo_box:!0},"al_voting.php":{export_box:!0},"docs.php":{show_box:!0}}),showReCaptchaBox:Widgets.showReCaptchaBox,gotSession:function(e){location.reload()},showPhoto:Widgets.showPhoto,showVideo:Widgets.showVideo,shareAudioPlaylist:function(e){vk.id?e.apply(null,[].slice.call(arguments,1)):Widgets.oauth()}.bind(null,shareAudioPlaylist),addAudio:function(e){vk.id?e.apply(null,[].slice.call(arguments,1)):Widgets.oauth()}.bind(null,AudioUtils.addAudio),showWiki:function(e){if("likes"==(e=(e&&e.w||"").split("/"))[0])WComments.showLikesBox(e[1]);else{if("shares"!=e[0])return!0;WComments.showLikesBox(e[1],{tab:"published"})}},mentionOver:function(){return!0},mentionClick:function(){return!0},showInlineVideo:Widgets.showInlineVideo,revertLastInlineVideo:Widgets.revertLastInlineVideo,pauseLastInlineVideo:Widgets.pauseLastInlineVideo});break;case jsc("web/emoji.js"):extend(Emoji,{focus:function(e,t){if(Emoji.editableFocus(e,!1,!0),t&&cur.scrollbar){var n=domCA(e,".reply_box");n&&cur.scrollbar.scrollIntoView(n)}}});break;case"page.js":(cur.options.is_auto||cur.options.is_nano)&&(Composer.init=(r=Composer.init,function(){var e=[].slice.call(arguments);return e[1].media&&(e[1].media.options=extend(e[1].media.options||{},{hideAfterCount:0,maxShown:0,forceToUp:1})),r.apply(Wall,e)})),extend(Wall,{scrollHighlightReply:function(e){(e=ge(e))&&(cur.options.fixed_height&&cur.scrollbar?cur.scrollbar.scrollIntoView(e,!0,Wall.highlightReply.bind(Wall,e)):(e.scrollIntoView(),Wall.highlightReply(e)))},postTooltip:(n=Wall.postTooltip,function(){var e=[].slice.call(arguments);return e[3]=extend(e[3]||{},{appendEl:cur.postsOuterEl}),n.apply(this,e)}),sendPost:function(){if(cur.sendPostBtn){var e=cur.wallAddMedia||{},t=e.chosenMedia||{},n=cur.wallAddMedia?e.getMedias():[],r=e.shareData||{},o=trim((window.Emoji?Emoji.editableVal:val)(ge("post_field"))),i=cur.options.suggesting?"suggest":cur.wallType,a={act:"post",message:o,to_id:cur.postTo,type:i,status_export:"",widget_app:cur.options.app,widget_page_url:cur.options.page_url,widget_page_title:cur.options.page_title,widget_page_desc:cur.options.page_desc,widget_page_query:cur.options.page_query,hash:cur.options.post_hash},s=(cur.postTo==vk.id||a.official||cur.options.only_official,0);if(isArray(t)&&t.length&&n.push(clone(t)),n.length){var c=!1;if(each(n,(function(t,n){if(n){var i=this[0],l=this[1];switch(i){case"poll":var u=e.pollData();if(!u)return c=!0,!1;l=u.media,delete u.media,a=extend(a,u);break;case"share":if(r.share_upload_failed)break;if(r.failed||!r.url||!r.title&&(!r.images||!r.images.length)&&!r.photo_url)return cur.shareLastParseSubmitted&&vkNow()-cur.shareLastParseSubmitted<2e3?(c=!0,!1):void 0;if(!(l=!r.noPhoto&&r.user_id&&r.photo_id?r.user_id+"_"+r.photo_id:"")&&!r.share_own_image&&r.images&&r.images.length&&r.images.some((function(e){return isString(e)&&e.length})))return e.uploadShare(Wall.sendPost),c=!0,!1;r.initialPattern&&trim(o)==r.initialPattern&&(a.message=""),r.is_vk_mini_app&&(a.is_vk_mini_app=!0,a.is_photo_edit=r.isPhotoEdit,a.image_offset=cur.shareShowImg),a=extend(a,{url:r.url,module:cur.module,title:replaceEntities(r.title),description:replaceEntities(r.description),extra:r.extra,extra_data:r.extraData,mode:r.mode,photo_url:r.noPhoto?"":replaceEntities(r.photo_url),open_graph_data:(r.openGraph||{}).data,open_graph_hash:(r.openGraph||{}).hash});break;case"page":r.initialPattern&&trim(o)==r.initialPattern&&(a.message="");break;case"postpone":var d=val("postpone_date"+e.lnkId);return a=extend(a,{postpone:d}),cur.postponedLastDate=d,void!0}this[3]&&trim(o)==this[3]&&(a.message=""),a["attach"+(s+1)+"_type"]=i,a["attach"+(s+1)]=l,s++}})),c)return}if(s||o){var l=ge("send_post");l&&buttonLocked(l)||(cur.postAutosave&&clearTimeout(cur.postAutosave),hide("submit_post_error"),cur.postSent=!0,setTimeout((function(){WComments.eventsPause(),ajax.post("al_wall.php",Wall.fixPostParams(a),{onDone:function(e){if(e){var t={act:"a_post",post:e,width:cur.options.width,startWidth:cur.options.startWidth,hash:cur.options.post_hash,app:cur.options.app,limit:cur.options.limit,export:isChecked("wcomments_export")};ajax.post("al_widget_comments.php",t,{onDone:function(e,t){"posts"==cur.section&&cur.Rpc&&cur.Rpc.callMethod("publish","widgets.comments.new_comment",e.count,e.last_comment,e.date,e.full_hash,e.pageId),val("wcomments_posts",t),WComments.contentUpdated(e),Wall.updateMentionsIndex(),WComments.eventsProceed()},onFail:function(){WComments.eventsProceed()},showProgress:function(){lockButton(ge("send_post"))},hideProgress:function(){Wall.clearInput(),cur.postSent=!1;var e=ge("post_field");if(cur.withMentions){var t=data(e,"mention");t&&(t.rtaEl.innerHTML="",hide(t.cont),show(e))}e.value="",e.blur(),e.phonblur(),Wall.hideEditPost(!0),cur.wallAddMedia&&cur.wallAddMedia.unchooseMedia(),hide("post_warn"),cur.onWallSendPost&&cur.onWallSendPost(),unlockButton(ge("send_post"))}})}},onFail:function(e){return cur.postSent=!1,!e||(ge("submit_post_error").innerHTML=e.length>60?'<div class="msg_text">'+e+"</div>":e,isVisible("submit_post_error")||slideDown("submit_post_error",100),!0)},showProgress:function(){lockButton(l)},hideProgress:function(){unlockButton(l)}})}),0))}else elfocus("post_field")}},sendReply:function(e,t,n){if(n=extend({},n),window.mvcur&&mvcur.post==e)return Videoview.sendComment(e,t,n);var r,o=window.cur.wallLayer==e,i=o?wkcur:window.cur,a=ge("reply_field"+e),s=a&&data(a,"composer"),c=i.reply_to&&Wall.getReplyName(i.reply_to[0]),l=a&&data(a,"send");if(l&&isFunction(l))return l(e,t,n);if(n.stickerId)var u={message:"",attach1_type:"sticker",attach1:n.stickerId,sticker_referrer:n.sticker_referrer};else{if((u=s?Composer.getSendParams(s,Wall.sendReply.pbind(e)):{message:trim(Emoji.editableVal(a))}).delayed)return;if(!u.attach1_type&&(!u.message||isArray(c)&&!c[1].indexOf(u.message)))return void Emoji.editableFocus(ge("reply_field"+e),!1,!0);s?r=Composer.reset(s):window.Emoji&&Emoji.val(a,""),a.autosize&&a.autosize.update()}i.wallMyOpened=i.wallMyOpened||{},i.wallMyReplied[e]=1,i.wallMyOpened[e]=1;var d=ge("post_hash"+e)?ge("post_hash"+e).value:i.options.post_hash,_=(ge("reply_as_group"+e),null);if(extend(u,{act:"post",type:"widget",width:i.options.width,startWidth:i.options.startWidth,reply_to:e,reply_to_msg:val("reply_to"+e),reply_to_user:i.reply_to&&i.reply_to[0]||0,start_id:val("start_reply"+e),from:"widget",hash:d}),i.reverse&&(u.rev=1),browser.mobile?Wall.hideEditReply(e):(Emoji.editableFocus(a,!1,!0),Wall.cancelReplyTo(e,t)),ajax.post("al_wall.php",Wall.fixPostParams(u),{onDone:function(t,n,r,o){if("full"==i.wallType)return FullWall.onReplySent.apply(window,arguments);i.wallMyReplied[e]=0,re("reply_link"+e),hide("reply_warn"+e),Wall._repliesLoaded(e,!1,n,r,o)},onFail:function(){_&&re(_),s?r=Composer.restore(s,r):val(a,u.message),a.autosize&&a.autosize.update()},showProgress:lockButton.pbind(ge("reply_button"+e)),hideProgress:unlockButton.pbind(ge("reply_button"+e))}),!u.from_oid&&u.message){var p=ge("replies"+e),h=-++i.wallMyRepliesCnt,f=Emoji.emojiToHTML(clean(u.message),!0),m=u.reply_to_user<0?getLang("wall_replied_to_group"):i.options.reply_names[u.reply_to_user]&&i.options.reply_names[u.reply_to_user][0],g=m?rs(i.wallTpl.reply_link_to,{to_user:m}):"";if(_=se(rs(i.wallTpl.reply_fast,{reply_id:"0_"+h,message:f.replace(/\n/g,"<br/>"),to_link:g,date:Wall.getNowRelTime(i)})),p&&!isVisible(p)||ge("reply_link"+e))re("reply_link"+e),show("replies_wrap"+e);else if(!i.onepost){var v=p.nextSibling;if(v&&"replies_open"==v.className&&Wall.openNewComments(e),!o){var y=geByClass1("wr_header",p,"a"),E=geByClass("reply",p,"div").length+1,w=E;y&&(w=intval(y.getAttribute("offs").split("/")[1])+1),(w>5||E<w)&&(y||p.insertBefore(y=ce("a",{className:"wr_header"}),p.firstChild),Wall.updateRepliesHeader(e,y,E,w))}}i.reverse?p.insertBefore(_,p.firstChild):p.appendChild(_)}},deletePost:function(e,t,n,r,o){(cur.wallLayer?wkcur:cur).wallMyDeleted[t]=1;var i=ge("post"+t),a=geByClass1("post_actions",i);ajax.post("al_wall.php",{act:"delete",post:t,hash:n,root:r?1:0,confirm:o?1:0,from:"widget"},{onDone:function(e,o,a){if(a)var s=showFastBox(e,a,getLang("global_delete"),(function(){s.hide(),wall.deletePost(t,n,r,1)}),getLang("box_cancel"));else{o&&"posts"==cur.section&&cur.Rpc&&cur.Rpc.callMethod("publish","widgets.comments.delete_comment",o.count,o.last_comment,o.date,o.full_hash,o.pageId);var c=geByClass1("_post_content",i)||geByClass1("feedback_row_t",i);revertLastInlineVideo(c);var l=ge("post_del"+t);l?(l.innerHTML='<span class="dld_inner">'+e+"</span>",show(l)):i.appendChild(ce("div",{id:"post_del"+t,className:"dld",innerHTML:'<span class="dld_inner">'+e+"</span>"})),hide(c),"post_publish"==domNS(c).className&&hide(domNS(c)),"full_own"==cur.wallType||"full_all"==cur.wallType?(Pagination.recache(-1),FullWall.updateSummary(cur.pgCount)):"full"==cur.wallType&&hasClass(i,"reply")&&(cur.pgOffset--,cur.pgCount--,FullWall.repliesSummary(cur.pgCount)),hasClass(i,"suggest")?Wall.suggestUpdate(-1):hasClass(i,"postponed")||"own"!=cur.wallType&&"all"!=cur.wallType||(hasClass(i,"own")&&++cur.deletedCnts.own,hasClass(i,"all")&&++cur.deletedCnts.all,Wall.update()),WComments.contentUpdated()}},showProgress:function(){hasClass(e,"ui_actions_menu_item")?lockActionsMenuItem(e):hasClass(e,"flat_button")?lockButton(e):addClass(a,"post_actions_progress")},hideProgress:function(){hasClass(e,"ui_actions_menu_item")?unlockActionsMenuItem(e):hasClass(e,"flat_button")?unlockButton(e):removeClass(a,"post_actions_progress")}});var s=ge("delete_post"+t);s&&s.tt&&s.tt.el&&s.tt.destroy()},restorePost:function(e,t,n){return(cur.wallLayer?wkcur:cur).wallMyDeleted[e]=0,ajax.post("al_wall.php",{act:"restore",post:e,hash:t,root:n?1:0,from:"widget"},{onDone:function(t){var n=ge("post_del"+e);if(n){var r=ge("post"+e),o=geByClass1("_post_content",r)||geByClass1("feedback_row_t",r);show(o),"post_publish"==domNS(o).className&&show(domNS(o)),hide(n),"full_own"==cur.wallType||"full_all"==cur.wallType?(Pagination.recache(1),FullWall.updateSummary(cur.pgCount)):"full"==cur.wallType&&hasClass(r,"reply")&&(cur.pgOffset++,cur.pgCount++,FullWall.repliesSummary(cur.pgCount)),hasClass(r,"suggest")?Wall.suggestUpdate(1):hasClass(r,"postponed")||"own"!=cur.wallType&&"all"!=cur.wallType||(hasClass(r,"own")&&--cur.deletedCnts.own,hasClass(r,"all")&&--cur.deletedCnts.all,Wall.update()),WComments.contentUpdated()}}}),!1},postClick:function(e,t,n){var r=(e||"").match(/^(-?\d+)_(wall)?(\d+)$/),o=ge("post"+e);if(n&&n.skipCheck)var i=!0;else i=Wall.checkPostClick(o,t);if(i){if(!0!==i){var a=geByClass1("wall_post_more",i,"a");if(a&&isVisible(a))return a.onclick(),void(r||removeClass(o,"wall_post_over"))}r&&(hasClass(ge("wcomments_posts"),"no_post_click")||window.open("wall"+r[1]+"_"+r[3],"_blank"))}},_repliesLoaded:function(e,t,n,r){var o=ge("replies"+e);if(o){if(t){browser.msie6?pageNode:browser.chrome||browser.safari?bodyNode:htmlNode,o.offsetHeight;cur.options.fixed_height&&cur.scrollbar?cur.scrollbar.updateAbove((function(){o.innerHTML=n})):o.innerHTML=n,setTimeout(Wall.scrollHighlightReply.pbind("post"+t),0)}else o.innerHTML=n;var i=o.nextSibling;i&&"replies_open"==i.className&&re(i),extend(cur.options.reply_names||{},r),Wall.updateMentionsIndex()}},checkTextLen:function(){},checkPostLen:function(){},replySubmitTooltip:function(){},repliesSideSetup:function(){},repliesSideClick:function(){},likesShow:function(e,t,n){n=n||{};var r=wall.parsePostId(t),o=r.type,i=r.id,a=o+i,s=e&&gpeByClass("_post_content",e)||wall.domPost(i),c=n.share?"_share_wrap":"_like_wrap",l=domByClass(s,c),u=domByClass(l,"_icon"),d=s&&domByClass(s,"_share_wrap");if(u&&!cur.viewAsBox){var _=getXY(l)[0],p=getXY(u)[0]+getSize(u,!0)[0]/2-_-56;showTooltip(u.parentNode,{url:"/like.php",params:extend({act:"a_get_stats",object:a,has_share:d?1:""},n.share?{published:1}:{}),slide:15,shift:[-p,-3],ajaxdt:100,showdt:400,hidedt:200,dir:"auto",checkLeft:!0,reverseOffset:80,appendEl:ge("page_wrap"),tip:{over:function(){Wall.likesShow(e,t,n)}},typeClass:"like_tt wcomments_like_tt",className:n.cl||""})}},showReplies:function(e,t,n,r){if(!checkEvent(r||window.event))return cur.viewAsBox?cur.viewAsBox():(cur.wallMyOpened[e]=3!=t,ajax.post("al_wall.php",{act:"get_replies",width:cur.options.width,startWidth:cur.options.startWidth,post:e,count:t,from:"widget"},{onDone:function(){var t=[].slice.call(arguments);t.unshift(e,n),Wall._repliesLoaded.apply(Wall,t),WComments.resizeWidget()},showProgress:lockButton.pbind("wrh"+e),hideProgress:unlockButton.pbind("wrh"+e)}),!1)}}),each(["showEditReply","markAsSpam","stickerClick","likeIt"],(function(e,t){var n;Wall[t]=(n=Wall[t],function(){if(vk.id)return n.apply(Wall,[].slice.call(arguments));Widgets.oauth()})}))}}};try{stManager.done(jsc("api/widgets/comments.js"))}catch(e){}})()})();